public bool DeleteAllRoleOfAccount(int accountId)
 {
     try
     {
         var accountRoleMap = GetAll().Where(n => n.AccountId == accountId).ToList();
         _database.RemoveRange(accountRoleMap);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
예제 #2
0
 public bool DeleteMap(int contentId)
 {
     try
     {
         var contentTagMaps = GetListMapTagByContent(contentId);
         _database.RemoveRange(contentTagMaps);
         _database.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
 public bool DeleteMapContentCategory(int contentId)
 {
     try
     {
         var listMap = _database.ContentCategoryMap.Where(n => n.ContentId == contentId);
         if (listMap != null && listMap.Any())
         {
             _database.RemoveRange(listMap);
             _database.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }