public async Task <bool> AddTrendingProduct(TrendingProduct trendingProduct) { await _context.AddAsync(trendingProduct); await _context.SaveChangesAsync(); return(await Task.FromResult(true)); }
public async Task <EvolucionTecnica> newEvolucionTecnica(CreateEvolucionTecnicaDTO model) { var evolucion = mapper.Map <EvolucionTecnica>(model); evolucion.fecha = DateTime.Today; await context.AddAsync(evolucion); await context.SaveChangesAsync(); return(evolucion); }
public async Task <bool> AddProduct(Product product) { await _context.AddAsync <Product>(product); await _context.SaveChangesAsync(); ProductElasticIndexDto productElasticIndexDto = new ProductElasticIndexDto(); productElasticIndexDto.Adapt(product); await CreateIndexes(productElasticIndexDto); return(await Task.FromResult <bool>(true)); }