PIAPS_CW/Contracts/Converters/PurchaseConverter.cs

34 lines
913 B
C#

using Contracts.BindingModels;
using Contracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.Converters
{
public class PurchaseConverter
{
public static PurchaseViewModel ToView(PurchaseBindingModel model) => new()
{
Id = model.Id,
DateCreated = model.DateCreated,
UserId = model.UserId,
Status = model.Status,
ProductCount = model.ProductCount,
Cost = model.Cost
};
public static PurchaseBindingModel ToBinding(PurchaseViewModel model) => new()
{
Id = model.Id,
DateCreated = model.DateCreated,
UserId = model.UserId,
Status = model.Status,
ProductCount = model.ProductCount,
Cost = model.Cost
};
}
}