public IEnumerable <SchedulingOutput> GetList() { var schedulings = _repository.Get(); var schedulingsOutput = schedulings.Select(s => SchedulingMapping.Map(s)); return(schedulingsOutput); }
public void AddNewScheduling(SchedulingInput input) { var scheduling = SchedulingMapping.Map(input); ValidateScheduling(scheduling); _repository.Add(scheduling); _unitOfWork.Commit(); }
public void UpdateScheduling(SchedulingInput input, int id) { var scheduling = SchedulingMapping.Map(input); var oldScheduling = _repository.Get(id); ValidateScheduling(scheduling); oldScheduling.DataHoraFim = scheduling.DataHoraFim; oldScheduling.DataHoraInicio = scheduling.DataHoraInicio; oldScheduling.Titulo = scheduling.Titulo; oldScheduling.IdSala = scheduling.IdSala; _repository.Update(oldScheduling); _unitOfWork.Commit(); }
public SchedulingOutput Get(int id) { var scheduling = _repository.Get(id); return(SchedulingMapping.Map(scheduling)); }