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

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