using BeautySaloonContracts.BindingModels;
using BeautySaloonContracts.ViewModels;
using BeautySaloonDataModels;
namespace BeautySaloonDatabaseImplement;
///
/// Сущность позиции
///
public partial class Position : IPositionModel
{
///
/// Идентификатор
///
public int Id { get; set; }
///
/// Название
///
public string Name { get; set; } = null!;
public virtual ICollection Employees { get; } = new List();
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
};
}