public async Task <BLLChangeDTO> GetChangeAsync(int changeId) { var changeDTO = await Uow.Changes.FindDTOAsync(changeId); if (changeDTO == null) { return(null); } return(ChangeMapper.FromDAL(changeDTO)); }
public async Task <DALChangeDTO> AddAsync(DALChangeDTO changeDTO) { var change = ChangeMapper.FromDAL(changeDTO); change = (await RepoDbSet.AddAsync(change)).Entity; if (change == null) { return(null); } await RepoDbContext.Entry(change).Reference(c => c.ChangeName).LoadAsync(); await RepoDbContext.Entry(change.ChangeName).Collection(c => c.Translations).LoadAsync(); return(ChangeMapper.FromDomain(change)); }