public async Task <FacturasProductosBase> Post([FromBody] FacturasProductosBase facturasP) { var facturasproductosbd = mapper.Map <FacturasProductos>(facturasP); context.Add(facturasproductosbd); await context.SaveChangesAsync(); return(facturasP); }
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)); }