Ejemplo n.º 1
0
        public async Task <FacturasProductosBase> Post([FromBody] FacturasProductosBase facturasP)
        {
            var facturasproductosbd = mapper.Map <FacturasProductos>(facturasP);

            context.Add(facturasproductosbd);
            await context.SaveChangesAsync();

            return(facturasP);
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Patch(int id, [FromBody] FacturasProductosBase facturasProducto)
        {
            var properties        = new UpdateMapperProperties <FacturasProductos, FacturasProductosBase>();
            var facturasproductos = context.FacturasProductos.Find(id);
            var result            = await properties.MapperUpdate(facturasproductos, facturasProducto);

            await context.SaveChangesAsync();

            return(Ok(result));
        }