示例#1
0
        public async Task <IActionResult> Update([FromBody] ProviderDto provider)
        {
            var providerDB = await providerRepository.FindByKey(provider.Id);

            if (providerDB == null)
            {
                return(BadRequest("El insumo no existe"));
            }

            mapper.Map(provider, providerDB);

            providerDB.FechaModificacion = DateTime.Now;

            await providerRepository.Edit(providerDB);

            return(Ok());
        }