Beispiel #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(serPerson));
            serPerson person = (serPerson)ser.ReadObject(stream);

            var record = personsContext.persons.First(p => p.ID == person.id);
            record.FName = person.fname;
            record.LName = person.lname;
        }
Beispiel #2
0
 public DAO()
 {
     personsContext = new PersonsEntities();
 }