2024-06-23 01:24:47 +04:00
|
|
|
|
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
|
|
|
|
|
{
|
2024-07-26 02:46:29 +04:00
|
|
|
|
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
|
|
|
|
|
};
|
2024-06-23 01:24:47 +04:00
|
|
|
|
|
2024-07-26 02:46:29 +04:00
|
|
|
|
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
|
|
|
|
|
};
|
|
|
|
|
}
|
2024-06-23 01:24:47 +04:00
|
|
|
|
}
|