public HttpResponseMessage Get() { SecureContext SC = new SecureContext(); string PassParameter = SC.GetHeaderParam("PassID"); JsonResponse Response = new JsonResponse(true, SC); Response.Create(); if (Response.IsAuthentic == true) { List <SeasonPass> Output = new List <SeasonPass>(); var Source = Umbraco.Content(1121).Children().Where("Visible"); if (Source.Count() > 0) { foreach (var Node in Source) { if ((string)Node.GetPropertyValue("passID") != PassParameter) { continue; } else { Output.Add(new SeasonPass { ID = "n/a", Holder = (string)Node.GetPropertyValue("holderName"), ValidFrom = Convert.ToDateTime(Node.GetPropertyValue("validFrom")).ToString("dd-MM-yyyy"), ValidTo = Convert.ToDateTime(Node.GetPropertyValue("validTo")).ToString("dd-MM-yyyy"), AcquiredOn = Convert.ToDateTime(Node.GetPropertyValue("acquiredOn")).ToString("dd-MM-yyyy") }); } } } Response.Set(new StringContent(JsonConvert.SerializeObject(Output), ApiContext.GetEncoding(), ApiContext.GetOutputType())); } return(Response.Get()); }
public UsersService(SecureContext context, IMapService mapService) { _context = context; _mapService = mapService; }
public AuthService(SecureContext context, IMapService mapService, IConfiguration configuration) { _context = context; _mapService = mapService; _configuration = configuration; }
public NotesService(SecureContext secureContext, IMapService mapService) { _secureContext = secureContext; _mapService = mapService; }