public async Task <ActionResult <IEnumerable <ServicoViewModel> > > Gets(int tipoServicoId) { servicoFactory = ServicoFactory.Create(this.isolationLevel); ServicoAbstract Servico = servicoFactory.getServico(); List <IServicoDominio> Servicos = await Servico.Gets(tipoServicoId); return(Json(Servicos.ToList().ConvertAll(new Converter <IServicoDominio, ServicoViewModel>(ServicoConfiguracao.converterIServicoDominioParaServicoViewModel)))); }
public async Task <IActionResult> Create([FromBody] ServicoViewModel model) { servicoFactory = ServicoFactory.Create(this.isolationLevel); ServicoAbstract Servico = servicoFactory.getServico(); IServicoDominio servicoDominio = ServicoConfiguracao.converterServicoViewModelParaIServicoDominio(model); var resultado = await Servico.Incluir(servicoDominio); return(Json(resultado.Succeeded)); }