Ejemplo n.º 1
0
        public async Task <IActionResult> Add(ProductDto productDto)
        {
            var newProduct = await _productService.AddAsync(_mapper.Map <Product>(productDto));

            return(Created(string.Empty, _mapper.Map <ProductDto>(newProduct)));
        }
 public Task <TEntity> AddAsync(TEntity model)
 {
     return(_serviceBase.AddAsync(model));
 }
 public async Task AddAsync(TEntity obj)
 {
     await _service.AddAsync(obj);
 }
Ejemplo n.º 4
0
 public virtual void AddAsync(TEntityViewModel entity)
 {
     _applicationBase.AddAsync(_mapper.Map <TEntity>(entity));
 }
 public async Task <IDataResult <int> > AddAsync(TEntityViewModel entityViewModel)
 {
     //return _mapper.Map<TEntityViewModel>(await _service.AddAsync(_mapper.Map<TEntity>(entityViewModel)));
     return(DataResult <int> .Success((await _service.AddAsync(_mapper.Map <TEntity>(entityViewModel)))));
 }
 public async Task <long> AddAsync(TEntity obj)
 {
     return(await _serviceBase.AddAsync(obj));
 }
Ejemplo n.º 7
0
 public Task <TEntity> AddAsync(TEntity Obj)
 {
     return(_serviceBase.AddAsync(Obj));
 }
Ejemplo n.º 8
0
        public async Task <IActionResult> Add(CategoryDto categoryDto)
        {
            var newCategory = await _categoryService.AddAsync(_mapper.Map <Category>(categoryDto));

            return(Created(string.Empty, _mapper.Map <CategoryDto>(newCategory)));
        }
Ejemplo n.º 9
0
        public async Task AddAsync(TViewModel viewModel)
        {
            await _service.AddAsync(ToEntity(viewModel));

            await SaveChangesAsync();
        }