* Added ItemCustPriceAll entity
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public interface IItemCustPriceAllService
|
||||
{
|
||||
Task<ItemCustPriceAllDto?> GetItemCustPriceAllAsync(string item, string customerNumber);
|
||||
}
|
||||
13
SytelineSaAppEfDataModel/Services/ItemCustPriceAllService.cs
Normal file
13
SytelineSaAppEfDataModel/Services/ItemCustPriceAllService.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using AutoMapper;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public class ItemCustPriceAllService(SytelineSaAppDbContext context, IMapper mapper) : IItemCustPriceAllService
|
||||
{
|
||||
public async Task<ItemCustPriceAllDto?> GetItemCustPriceAllAsync(string item, string customerNumber)
|
||||
{
|
||||
return await Task.FromResult(mapper.Map<ItemCustPriceAllDto?>(context.ItemCustPriceAlls
|
||||
.OrderByDescending(x => x.EffectDate).FirstOrDefault(x => x.Item == item && x.CustNum == customerNumber)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user