Ejemplo n.º 1
0
 public static Entities.Category Map(ApplicationCore.Models.Category category)
 {
     return(new Entities.Category
     {
         //CategoryId = category.CategoryId,
         Category1 = category.CategoryString
     });
 }
Ejemplo n.º 2
0
        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));
        }