public bool DeleteAllRoleOfAccount(int accountId) { try { var accountRoleMap = GetAll().Where(n => n.AccountId == accountId).ToList(); _database.RemoveRange(accountRoleMap); return(true); } catch { return(false); } }
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); } }