public async Task <IAuthors> Edit(IAuthors author) { author.ID = Guid.NewGuid(); AuthorsEntity authorE = _mapper.Map <AuthorsEntity>(author); dbSet.Add(authorE); await _context.SaveChangesAsync(); return(_mapper.Map <IAuthors>(author)); }
public async Task <IAuthors> Edit(IAuthors author) { //var authors = _context.Authors.Where(v => v.Name.Contains(book.AutorId.ToString())).FirstOrDefault(); author.ID = Guid.NewGuid(); AuthorsEntity authorE = _mapper.Map <AuthorsEntity>(author); dbSet.Add(authorE); await _context.SaveChangesAsync(); return(_mapper.Map <IAuthors>(author)); }
public AuthorModel MapAuthorEntityToAuthorModel(AuthorsEntity authorsEntity) { return(_mapper.Map <AuthorModel>(authorsEntity)); }
public AuthorModel MapAuthorEntityToAuthorModel(AuthorsEntity authorsEntity) { var config = new Mapper(MapperConfiguration()); return(config.Map <AuthorModel>(authorsEntity)); }