public static Entities.Category Map(ApplicationCore.Models.Category category) { return(new Entities.Category { //CategoryId = category.CategoryId, Category1 = category.CategoryString }); }
public async Task <ApplicationCore.Models.Category> AddCategoryAsync(ApplicationCore.Models.Category category) { if (category is null) { throw new ArgumentNullException(nameof(category)); } Entities.Category entity = Mapper.Map(category); await _context.Category.AddAsync(entity); await _context.SaveChangesAsync(); return(Mapper.Map(entity)); }