Esempio n. 1
0
 public User Create(User inputObject)
 {
     using (GoKeyboardDbContext context = new GoKeyboardDbContext())
     {
         context.Users.Add(inputObject);
         context.SaveChanges();
         return inputObject;
     }
 }
Esempio n. 2
0
        public User Update(User inputObject)
        {
            using (GoKeyboardDbContext context = new GoKeyboardDbContext())
            {
                context.Users.Attach(inputObject);
                context.Entry(inputObject).State = EntityState.Modified;

                    context.SaveChanges();
                    return inputObject;
            }
        }