예제 #1
0
 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);
     }
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
        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));
 }
예제 #5
0
        public async Task <List <Boat> > GetBoatsForCustomer(int customerId)
        {
            var boats = await context.Set <Boat>().ToListAsync();

            return(boats.Where(x => x.CustomerId == customerId).ToList());
        }