public static void GerarProfissional(IProfissionalRepository profissionalRepository) { var enderecoEmpresa = new Endereco("Logradouro", "17420000", "10", "SAO PAULO", "SÃO PAULO", "CENTRO"); var empresa = new Empresa("RazaoSocial", "NomeFantasia", "000000000", enderecoEmpresa, true, 10, 10, 10, "SindicatoEmpresa", RegimeTributario.LucroPresumido, "CategoriaProfissional", 10000, 1000, true, new DateTime(2019, 04, 14)); var profissional = new Profissional("Profissional", "123456789", empresa, "lala", "lolo"); profissionalRepository.Save(profissional); }
public void Post([FromBody] Profissional profissional) { try { _repository.Save(profissional); } catch (Exception e) { Console.WriteLine(e); //throw; } }