Answer the question
In order to leave comments, you need to log in
How to convert from one type to another?
And here is its interface implementation:
public async Task<ProductDto> AddAsync(ProductDto item)
{
var product = await _unitOfWork.ProductRepository.AddAsync(item);
return _mapper.Map<ProductDto>(product);
}
public async Task<Product> AddAsync(Product id)
{
_context.Set<Product>().Add(id);
await _context.SaveChangesAsync();
return id;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question