SUBD_PIbd-21_Balberova_D.N./BeautySaloon/BeautySaloonDatabaseImplement/Position.cs

43 lines
948 B
C#
Raw Normal View History

2023-03-28 21:24:52 +04:00
using BeautySaloonContracts.BindingModels;
using BeautySaloonContracts.ViewModels;
using BeautySaloonDataModels;
namespace BeautySaloonDatabaseImplement;
/// <summary>
/// Сущность позиции
/// </summary>
public partial class Position : IPositionModel
{
/// <summary>
/// Идентификатор
/// </summary>
public int Id { get; set; }
/// <summary>
/// Название
/// </summary>
public string Name { get; set; } = null!;
public virtual ICollection<Employee> Employees { get; } = new List<Employee>();
public static Position Create(PositionBindingModel model)
{
return new Position()
{
Id = model.Id,
Name = model.Name
};
}
public void Update(PositionBindingModel model)
{
Name = model.Name;
}
public PositionViewModel GetViewModel => new()
{
Id = Id,
Name = Name
};
}