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));
        }
Beispiel #3
0
 public AuthorModel MapAuthorEntityToAuthorModel(AuthorsEntity authorsEntity)
 {
     return(_mapper.Map <AuthorModel>(authorsEntity));
 }
Beispiel #4
0
        public AuthorModel MapAuthorEntityToAuthorModel(AuthorsEntity authorsEntity)
        {
            var config = new Mapper(MapperConfiguration());

            return(config.Map <AuthorModel>(authorsEntity));
        }