Inventory details
This commit is contained in:
@@ -27,6 +27,8 @@ namespace InventoryTraker.Web.Models
|
||||
|
||||
public string Memo { get; set; }
|
||||
|
||||
public bool IsExpired => ExpirationDate < DateTime.Today;
|
||||
|
||||
public void CreateMappings(IMapperConfiguration configuration)
|
||||
{
|
||||
configuration.CreateMap<Inventory, InventoryViewModel>()
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace InventoryTraker.Web.Models
|
||||
{
|
||||
[Required]
|
||||
public int Id { get; set; }
|
||||
public int InventoryId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
public int UnitsPerCase { get; set; }
|
||||
@@ -36,6 +37,8 @@ namespace InventoryTraker.Web.Models
|
||||
public void CreateMappings(IMapperConfiguration configuration)
|
||||
{
|
||||
configuration.CreateMap<Transaction, TransactionViewModel>()
|
||||
.ForMember(d => d.InventoryId,
|
||||
opt => opt.MapFrom(s => s.Inventory.Id))
|
||||
.ForMember(d => d.Name,
|
||||
opt => opt.MapFrom(s => s.Inventory.InventoryType.Name))
|
||||
.ForMember(d => d.ExpirationDate,
|
||||
|
||||
Reference in New Issue
Block a user