コード例 #1
0
 public SectionDTO addSection(SectionDTO section)
 {
     using (var uow = new UnitOfWork())
     {
         var repo  = uow.getRepository <Section>();
         var saved = repo.save(converter.convertToPOCOModel(section));
         uow.saveChanges();
         return(converter.convertToDTOModel(saved));
     }
 }
コード例 #2
0
 public ReviewDTO addReview(ReviewDTO model)
 {
     using (var uow = new UnitOfWork())
     {
         var review = converter.convertToPOCOModel(model);
         var repo   = uow.getRepository <Review>();
         var added  = repo.save(review);
         uow.saveChanges();
         if (added == null)
         {
             return(null);
         }
         return(converter.convertToDTOModel(added));
     }
 }