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)); }
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)); }
public IHttpActionResult Update(DTOStudentDiary dtoStudentDiary) { _studentDiaryService.Update(dtoStudentDiary); return(Ok()); }