Example #1
0
File: WoWCore.cs Project: duylt/wow
 public bool AddUser(User user)
 {
     using (var entity = new WakeOrWasteEntities())
     {
         entity.Configuration.ProxyCreationEnabled = false;
         var rs = entity.Users.Add(user);
         entity.SaveChanges();
         return rs != null;
     }
 }
Example #2
0
File: WoWBiz.cs Project: duylt/wow
 public bool CreateNewUser(User user)
 {
     return _core.AddUser(user);
 }
Example #3
0
File: WoWBiz.cs Project: duylt/wow
 /// <summary>
 /// Update User
 /// </summary>
 /// <param name="user"></param>
 /// <returns></returns>
 public bool UpdateUser(User user)
 {
     return _core.UpdateUser(user);
 }
Example #4
0
File: WoWCore.cs Project: duylt/wow
 public bool UpdateUser(User user)
 {
     using (var entity = new WakeOrWasteEntities())
     {
         entity.Configuration.ProxyCreationEnabled = false;
         var userToUpdated = entity.Users.FirstOrDefault(u => u.Id == user.Id);
         if (userToUpdated != null)
         {
             userToUpdated.Name = user.Name;
             userToUpdated.ImageUrl = user.ImageUrl;
             entity.SaveChanges();
             return true;
         }
         return false;
     }
 }