Whatever this is
This commit is contained in:
@@ -12,26 +12,28 @@ namespace PartSource.Services
|
||||
{
|
||||
public class PartService
|
||||
{
|
||||
private readonly PartSourceContext _context;
|
||||
private readonly PartSourceContext _partSourceContext;
|
||||
private readonly FitmentContext _fitmentContext;
|
||||
|
||||
public PartService(PartSourceContext context)
|
||||
public PartService(PartSourceContext partSourceContext, FitmentContext fitmentContext)
|
||||
{
|
||||
_context = context;
|
||||
_partSourceContext = partSourceContext;
|
||||
_fitmentContext = fitmentContext;
|
||||
}
|
||||
|
||||
public async Task<PartsAvailability> GetInventory(int sku, int storeNumber)
|
||||
{
|
||||
return await _context.PartAvailabilities.FirstOrDefaultAsync(s => s.Store == storeNumber && s.SKU == sku);
|
||||
return await _partSourceContext.PartAvailabilities.FirstOrDefaultAsync(s => s.Store == storeNumber && s.SKU == sku);
|
||||
}
|
||||
|
||||
public async Task<Part> GetPartBySku(string sku)
|
||||
{
|
||||
return await _context.Parts.SingleOrDefaultAsync(p => p.Sku == sku);
|
||||
return await _fitmentContext.Parts.SingleOrDefaultAsync(p => p.Sku == sku);
|
||||
}
|
||||
|
||||
public async Task<IList<DcfMapping>> GetDcfMapping(string partsourceLineCode)
|
||||
{
|
||||
return await _context.DcfMappings
|
||||
return await _fitmentContext.DcfMappings
|
||||
.Where(dcf => dcf.LineCode == partsourceLineCode)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user