Beispiel #1
0
 public Guid Create(DTOSchool dtoSchool)
 {
     dtoSchool.CreatedDate = DateTime.Now;
     dtoSchool.IsDeleted   = false;
     dtoSchool.Id          = Guid.NewGuid();
     _repository.Add(_mapper.Map <DTOSchool, School>(dtoSchool));
     return(dtoSchool.Id);
 }
Beispiel #2
0
        public void Update(DTOSchool dtoSchool)
        {
            var school = Get(dtoSchool.Id);

            dtoSchool.UpdateDate = DateTime.Now;
            var mergedSchool = _mapper.Map(dtoSchool, school);

            _repository.Update(_mapper.Map <DTOSchool, School>(mergedSchool));
        }
Beispiel #3
0
 public IHttpActionResult Update(DTOSchool dtoSchool)
 {
     _schoolService.Update(dtoSchool);
     return(Ok());
 }