public ExceptionLog GetExceptionLog(int logId) { var coreDbContext = (DbContextBase)_dc; var log = _dc.Set <Log>().Include("ExceptionLog").FirstOrDefault(l => l.Id == logId); if (log != null) { return(log.ExceptionLog); } return(null); }
public void DeleteWithRoles(User user) { var findedUser = _dbContext.Set <User>().AsNoTracking().Include("UserProfile").FirstOrDefault(a => a.Id == user.Id); if (findedUser != null) { LogicalDelete(findedUser, true); } //var userRoles = findedUser.UserRoles; //Update(findedUser); }
//... public BaseRepository(IDbContextBase context) { Context = context; Set = Context.Set <TEntity>(); }
public List <int> GetViewElementsIdByRoleId(int?roleId) { return(_dbContext.Set <ViewElementRole>().Where(a => a.RoleId == roleId).Select(viewElementRole => viewElementRole.ViewElementId).ToList()); }