Пример #1
0
        public void Update(DTOStudentDiary dtoStudentDiary)
        {
            var studentDiary = Get(dtoStudentDiary.Id);

            dtoStudentDiary.UpdateDate = DateTime.Now;
            var mergedstudentDiary = _mapper.Map(dtoStudentDiary, studentDiary);

            _repository.Update(_mapper.Map <DTOStudentDiary, StudentDiary>(mergedstudentDiary));
        }
Пример #2
0
 public void Create(DTOStudentDiary dtoStudentDiary)
 {
     dtoStudentDiary.CreatedDate  = DateTime.Now;
     dtoStudentDiary.IsDeleted    = false;
     dtoStudentDiary.Id           = Guid.NewGuid();
     dtoStudentDiary.InstructorId = null;
     dtoStudentDiary.School       = null;
     _repository.Add(_mapper.Map <DTOStudentDiary, StudentDiary>(dtoStudentDiary));
 }
Пример #3
0
 public IHttpActionResult Update(DTOStudentDiary dtoStudentDiary)
 {
     _studentDiaryService.Update(dtoStudentDiary);
     return(Ok());
 }