예제 #1
0
        public async Task <ApplicationResult> Index(int?id)
        {
            if (id != null)
            {
                return(await RickLocationUtil.CallService <Rick>("sucess",
                                                                 String.Format("Erro ao obter o Rick {0} ", id),
                                                                 async() => { return await rickService.GetRick((int)id); }));
            }

            return(await RickLocationUtil.CallService <IEnumerable <Rick> >("sucess",
                                                                            "Erro os Listar os Ricks",
                                                                            async() => { return await rickService.GetAllRicks(); }));
        }
예제 #2
0
 public async Task <ApplicationResult> Travels(int id)
 {
     return(await RickLocationUtil.CallService <IEnumerable <Travel> >("sucess",
                                                                       "Erro os Listar os Ricks",
                                                                       async() => { return await rickService.GetRicksTravels(id); }));
 }
예제 #3
0
 public async Task <ApplicationResult> Create(RickDto rickDto)
 {
     return(await RickLocationUtil.CallService <Rick>("sucess",
                                                      String.Format("Erro inesperado ao Cadastrar Rick na Dimensão {0}", rickDto.Dimension),
                                                      async() => { return await rickService.Create(rickDto.Dimension); }));
 }
예제 #4
0
 public async Task <ApplicationResult> Create(TravelDto travelDto)
 {
     return(await RickLocationUtil.CallService <Travel>("sucess",
                                                        String.Format("Erro inesperado ao Realizar viagem para o rick {0}", travelDto.RickId),
                                                        async() => { return await travelService.Create(travelDto.RickId, travelDto.DimensionId); }));
 }