public static VacationDescription ToModel(this VacationDescriptionDto model) { return(new VacationDescription() { Id = model.Id, Length = model.Length, Name = model.Name, Start = model.Start }); }
public static VacationDescriptionDto AttachUserSet(this VacationDescriptionDto model, int userSet) { if (userSet < 0) { model.UseLength = 0; } else if (userSet > model.Length) { model.UseLength = model.Length; } else { model.UseLength = userSet; } return(model); }