public override async Task <List <Lease> > GetAll() { try { return(await context.Set <Lease>().Include("LeaseType").ToListAsync()); } catch (Exception ex) { logger.LogDebug($"Error in GetAllLeases. Error: {ex.Message}"); return(null); } }
public virtual async Task <List <T> > GetAll() { try { return(await context.Set <T>().ToListAsync()); } catch (Exception ex) { logger.LogDebug($"Error in GetAll. T: {typeof(T)} Error: {ex.Message}"); return(null); } }
public async Task <List <Slip> > GetAvailableSlips() { var unavailableSlipIds = await GetUnavailableSlipIds(); var slipsForDock = await context.Set <Slip>().Include(x => x.Dock.Location).ToListAsync(); return(slipsForDock.Where(x => !unavailableSlipIds.Contains(x.Id)).ToList()); }
public async Task <Authorize> GetByUserName(string userName) { return(await context.Set <Authorize>().FirstOrDefaultAsync(x => x.UserName == userName)); }
public async Task <List <Boat> > GetBoatsForCustomer(int customerId) { var boats = await context.Set <Boat>().ToListAsync(); return(boats.Where(x => x.CustomerId == customerId).ToList()); }