Пример #1
0
        public string toJSONstring(person record)
        {
            DBService.Person p = new DBService.Person();

            p.id = record.ID;
            p.fname = record.FName;
            p.lname = record.LName;

            MemoryStream stream = new MemoryStream();
            DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(DBService.Person));
            ser.WriteObject(stream, p);

            stream.Position = 0;
            StreamReader sr = new StreamReader(stream);

            return sr.ReadToEnd();
        }
Пример #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the persons EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTopersons(person person)
 {
     base.AddObject("persons", person);
 }
Пример #3
0
 /// <summary>
 /// Create a new person object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static person Createperson(global::System.Int32 id)
 {
     person person = new person();
     person.ID = id;
     return person;
 }