예제 #1
0
 public async Task <JourneyResponseModel> GetJourneys(SessionDeviceDataModel sessionDeviceModel, JourneyRequestDataModel journeyModel)
 => await Execute <JourneyRequestModel, JourneyResponseModel>("journey/getbusjourneys", new JourneyRequestModel
 {
     Data          = journeyModel,
     DeviceSession = sessionDeviceModel,
     Date          = DateTime.UtcNow,
     Language      = "tr-TR"
 });
예제 #2
0
 public async Task <BusLocationResponseModel> GetBusLocations(SessionDeviceDataModel sessionDeviceModel)
 => await Execute <BusLocationRequestModel, BusLocationResponseModel>("location/getbuslocations", new BusLocationRequestModel
 {
     Data          = null,
     Language      = "tr-TR",
     DeviceSession = sessionDeviceModel,
     Date          = DateTime.UtcNow,
 });
예제 #3
0
        public async Task <SessionDeviceDataModel> GetSessionDeviceData()
        {
            SessionDeviceDataModel model = default;
            var sessionValue             = _session.GetString(_deviceDataSessionKey);

            if (string.IsNullOrWhiteSpace(sessionValue))
            {
                model = (await _mediator.Send(new GetSessionQuery()))?.Data;
            }
            else
            {
                model = JsonConvert.DeserializeObject <SessionDeviceDataModel>(sessionValue);
            }

            return(model);
        }
예제 #4
0
 public void SetSessionDeviceData(SessionDeviceDataModel model)
 => _session.SetString(_deviceDataSessionKey, JsonConvert.SerializeObject(model));