Ejemplo n.º 1
0
 public static int Add(ErrorsLog error)
 {
     using (PicPopEntities db = new PicPopEntities())
     {
         db.ErrorsLogs.Add(error);
         return db.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public void EditRoles(string id, List<string> lst )
 {
     using (PicPopEntities db = new PicPopEntities())
     {
         var source = db.AspNetUsers.FirstOrDefault(x => x.Id.Equals(id));
         if (source == null)
             return;
         source.AspNetRoles.Clear();
         foreach (var item in db.AspNetRoles.Where(x => lst.Contains(x.Id)).ToList())
         {
             source.AspNetRoles.Add(item);
         }
         db.SaveChanges();
     }
 }