public async Task <Advertisement> InsertAdvertisementAsync(Advertisement advertisement) { DAL.Entities.Advertisement dbAdvertisement = _mapper.Map <DAL.Entities.Advertisement>(advertisement); _context.Advertisements.Add(dbAdvertisement); await _context.SaveChangesAsync(); return(_mapper.Map <Advertisement>(dbAdvertisement)); }
public async Task <Category> AddCategoryAsync(Category category) { var dbCategory = _mapper.Map <DAL.Entities.Category>(category); _context.Categories.Add(dbCategory); await _context.SaveChangesAsync(); return(_mapper.Map <Category>(dbCategory)); }