30 lines
646 B
C#
30 lines
646 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,
|
|
DatePurchase = model.DatePurchase,
|
|
User = model.User,
|
|
Products = model.Products,
|
|
};
|
|
|
|
public static PurchaseBindingModel ToBinding(PurchaseViewModel model) => new()
|
|
{
|
|
Id = model.Id,
|
|
DatePurchase = model.DatePurchase,
|
|
User = model.User,
|
|
Products = model.Products,
|
|
};
|
|
}
|
|
}
|