42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using LawFirmDataModels.Models;
|
|
using LawFirmContracts.BindingModels;
|
|
using LawFirmContracts.ViewModels;
|
|
|
|
namespace LawFirmListImplement.Models
|
|
{
|
|
public class Blank : IBlankModel
|
|
{
|
|
public int Id { get; private set; }
|
|
public string BlankName { get; private set; } = string.Empty;
|
|
public double Price { get; set; }
|
|
public static Blank? Create(BlankBindingModel? model)
|
|
{
|
|
if (model == null)
|
|
{
|
|
return null;
|
|
}
|
|
return new Blank()
|
|
{
|
|
Id = model.Id,
|
|
BlankName = model.BlankName,
|
|
Price = model.Price
|
|
};
|
|
}
|
|
public void Update(BlankBindingModel? model)
|
|
{
|
|
if (model == null)
|
|
{
|
|
return;
|
|
}
|
|
BlankName = model.BlankName;
|
|
Price = model.Price;
|
|
}
|
|
public BlankViewModel GetViewModel => new()
|
|
{
|
|
Id = Id,
|
|
BlankName = BlankName,
|
|
Price = Price
|
|
};
|
|
}
|
|
}
|