2023-04-07 13:15:55 +04:00

41 lines
976 B
C#

using HotelContracts.BindingModels;
using HotelContracts.ViewModels;
using HotelDataModels.Models;
namespace HotelDatabaseImplement.Models;
public class CleaningInstruments : ICleaningInstrumentsModel
{
public int Id { get; set; }
public string Type { get; set; }
public static CleaningInstruments Create(CleaningInstrumentsBindingModel model)
{
return new CleaningInstruments
{
Id = model.Id,
Type = model.Type
};
}
public static CleaningInstruments Create(CleaningInstrumentsViewModel model)
{
return new CleaningInstruments
{
Id = model.Id,
Type = model.Type
};
}
public void Update(CleaningInstrumentsBindingModel? model)
{
if (model == null) return;
Type = model.Type;
}
public CleaningInstrumentsViewModel GetView => new CleaningInstrumentsViewModel
{
Id = Id,
Type = Type
};
}