コード例 #1
0
        public IEnumerable <SchedulingOutput> GetList()
        {
            var schedulings = _repository.Get();

            var schedulingsOutput = schedulings.Select(s => SchedulingMapping.Map(s));

            return(schedulingsOutput);
        }
コード例 #2
0
        public void AddNewScheduling(SchedulingInput input)
        {
            var scheduling = SchedulingMapping.Map(input);

            ValidateScheduling(scheduling);

            _repository.Add(scheduling);
            _unitOfWork.Commit();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        public SchedulingOutput Get(int id)
        {
            var scheduling = _repository.Get(id);

            return(SchedulingMapping.Map(scheduling));
        }