示例#1
0
        public void fromJSONstring(personsEntities personsContext, string jsonstring)
        {
            MemoryStream stream = new MemoryStream();
            stream.Write(new ASCIIEncoding().GetBytes(jsonstring), 0, jsonstring.Length);
            stream.Position = 0;
            DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(DBService.Person));
            DBService.Person person = (DBService.Person)ser.ReadObject(stream);

            var record = personsContext.persons.First(p => p.ID == person.id);
            record.FName = person.fname;
            record.LName = person.lname;
        }
示例#2
0
 public DBService()
 {
     personsContext = new personsEntities();
     conv = new JSONconverter();
 }