示例#1
0
        public override FileDTO Add(FileDTO entity)
        {
            var file = DTOService.ToEntity <FileDTO, File>(entity);

            currentRepo.Insert(file);
            uow.Commit();
            return(DTOService.ToDTO <File, FileDTO>(file));
        }
示例#2
0
        public virtual DTO Update(DTO entity)
        {
            var changedDomainEntity = DTOService.ToEntity <DTO, DomainEntity>(entity);

            currentRepo.Update(changedDomainEntity);
            uow.Commit();
            return(DTOService.ToDTO <DomainEntity, DTO>(changedDomainEntity));
        }
示例#3
0
        public NoteDTO Update(NoteDTO noteToChange)
        {
            var changedNote = DTOService.ToEntity <NoteDTO, Note>(noteToChange);

            uow.NoteRepo.Update(changedNote);
            uow.Commit();
            return(DTOService.ToDTO <Note, NoteDTO>(changedNote));
        }
示例#4
0
        public virtual DTO Add(DTO entity)
        {
            var entityToAdd = DTOService.ToEntity <DTO, DomainEntity>(entity);

            currentRepo.Insert(entityToAdd);
            uow.Commit();
            return(DTOService.ToDTO <DomainEntity, DTO>(entityToAdd));
        }
示例#5
0
        public NoteDTO Add(NoteDTO noteToAdd)
        {
            var newNote = DTOService.ToEntity <NoteDTO, Note>(noteToAdd);

            uow.NoteRepo.Insert(newNote);
            uow.Commit();
            return(DTOService.ToDTO <Note, NoteDTO>(newNote));
        }