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)); } }
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)); } }