public async Task <ActionResult> Patch(int id, [FromBody] EmpresasBase empresasb) { var properties = new UpdateMapperProperties <Empresas, EmpresasBase>(); var empresa = context.Empresas.Find(id); var result = await properties.MapperUpdate(empresa, empresasb); await context.SaveChangesAsync(); return(Ok(result)); }
public async Task <ActionResult> Patch(int id, [FromBody] TipoClientesBase tipoClientesDTO) { var properties = new UpdateMapperProperties <TipoClientes, TipoClientesBase>(); var tipocliente = context.TipoClientes.Find(id); var result = await properties.MapperUpdate(tipocliente, tipoClientesDTO); await context.SaveChangesAsync(); return(Ok(result)); }
public async Task <ActionResult> Patch(int id, [FromBody] CategoriasBase categoriasb) { var properties = new UpdateMapperProperties <Categorias, CategoriasBase>(); var categoria = context.Categorias.Find(id); var result = await properties.MapperUpdate(categoria, categoriasb); await context.SaveChangesAsync(); return(Ok(result)); }
public async Task <ActionResult> Patch(int id, [FromBody] ClientesBase clientesb) { var properties = new UpdateMapperProperties <Clientes, ClientesBase>(); var cliente = context.Clientes.Find(id); var result = await properties.MapperUpdate(cliente, clientesb); await context.SaveChangesAsync(); return(Ok(result)); }
public async Task <ActionResult> Patch(int id, [FromBody] FacturasBase facturasDTO) { var properties = new UpdateMapperProperties <Facturas, FacturasBase>(); var facturas = context.Facturas.Find(id); var result = await properties.MapperUpdate(facturas, facturasDTO); await context.SaveChangesAsync(); return(Ok(result)); }
public async Task <ActionResult> Patch(int id, [FromBody] ProductosBase productosb) { var properties = new UpdateMapperProperties <Productos, ProductosBase>(); var producto = context.Productos.Find(id); var result = await properties.MapperUpdate(producto, productosb); producto.Categorias = context.Categorias.Find(producto.CategoriaId); await context.SaveChangesAsync(); return(Ok(result)); }