Esempio n. 1
0
 public ITransport GetTransport(TransportTypes type)
 {
     return(_container.Resolve <ITransport>(type.ToString()));
 }
Esempio n. 2
0
        public async Task <StopsModel> Get(string stopName, TransportTypes transportType)
        {
            var queryString = @"mutation stopPlace ($transportType: String!
                                                    $query: String!)
                                                        { stopPlace(size: 10, stopPlaceType: $transportType, ,query: $query) 
                                                            { 
                                                             name 
                                                                { 
                                                                value 
                                                                } 
                                                             }
                                                         }";

            try
            {
                var result = await _simpleGraphQlClient.Execute(queryString, new { transport = transportType.ToString(), query = stopName });

                var stopsModels = new StopsModel
                {
                    Name   = result.data["stopPlace"].name.value,
                    StopId = result.data["stopPlace"].id
                };

                return(stopsModels);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }