Пример #1
0
        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))));
        }
Пример #2
0
        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));
        }