42 lines
1.4 KiB
C#
42 lines
1.4 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using LCU.Shared.Collections.RepoApiLib.Models;
|
|
using LCU.Shared.Collections.RepoApiLib.Persistence;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace LCU.Shared.Collections.RepoApiLib.Repositories
|
|
{
|
|
public class VehicleFloorPricingParametersRepository : BaseRepository, IVehicleFloorPricingParametersRepository
|
|
{
|
|
|
|
public VehicleFloorPricingParametersRepository(AppDbContext context) : base(context)
|
|
{
|
|
}
|
|
|
|
public async Task<IEnumerable<VehicleFloorPricingParameters>> ListAllAsync()
|
|
{
|
|
return await _context.VehicleFloorPricingParameters.ToListAsync();
|
|
}
|
|
|
|
public async Task AddAsync(VehicleFloorPricingParameters parameters)
|
|
{
|
|
await _context.VehicleFloorPricingParameters.AddAsync(parameters);
|
|
}
|
|
|
|
public async Task<VehicleFloorPricingParameters> FindByIdAsync(int id)
|
|
{
|
|
return await Queryable.Where<VehicleFloorPricingParameters>(_context.VehicleFloorPricingParameters, c => c.Id == id).FirstOrDefaultAsync();
|
|
}
|
|
|
|
public void Update(VehicleFloorPricingParameters parameters)
|
|
{
|
|
_context.VehicleFloorPricingParameters.Update(parameters);
|
|
}
|
|
|
|
public void Remove(VehicleFloorPricingParameters parameters)
|
|
{
|
|
_context.VehicleFloorPricingParameters.Remove(parameters);
|
|
}
|
|
}
|
|
} |