Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 3
0
        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));
        }