public RestSnapshot(ParameterContextSurface parmContext, ListContextSurface listContext, HttpRequestMessage req, RestControlFlags flags) : this(req, true) { logger.DebugFormat("RestSnapshot:parameterprompt"); populator = () => { representation = PromptRepresentation.Create(parmContext, listContext, req, flags); SetHeaders(); }; }
protected ListRepresentation(ListContextSurface listContext, HttpRequestMessage req, RestControlFlags flags) : base(flags) { Value = listContext.List.Select(c => CreateObjectLink(req, c)).ToArray(); SelfRelType = new ListRelType(RelValues.Self, SegmentValues.Services, new UriMtHelper(req, listContext.ElementType)); SetLinks(req); SetExtensions(); SetHeader(listContext.IsListOfServices); }
public RestSnapshot(ListContextSurface listContext, HttpRequestMessage req, RestControlFlags flags) : this(req, true) { logger.DebugFormat("RestSnapshot:ServicesList"); populator = () => { representation = ListRepresentation.Create(listContext, req, flags); SetHeaders(); }; }
protected PromptRepresentation(PropertyContextSurface propertyContext, ListContextSurface listContext, HttpRequestMessage req, RestControlFlags flags) : base(flags) { SetScalars(propertyContext.Property.Id); SetChoices(listContext, propertyContext, req); SelfRelType = new PromptRelType(RelValues.Self, new UriMtHelper(req, propertyContext)); SetLinks(req, listContext.ElementType, new ObjectRelType(RelValues.Up, new UriMtHelper(req, propertyContext.Target))); SetExtensions(); SetHeader(listContext.IsListOfServices); }
protected PromptRepresentation(ParameterContextSurface parmContext, ListContextSurface listContext, HttpRequestMessage req, RestControlFlags flags) : base(flags) { SetScalars(parmContext.Id); SetChoices(listContext, parmContext, req); SelfRelType = new PromptRelType(RelValues.Self, new UriMtHelper(req, parmContext)); var helper = new UriMtHelper(req, parmContext.Target); ObjectRelType parentRelType = parmContext.Target.Specification.IsService() ? new ServiceRelType(RelValues.Up, helper) : new ObjectRelType(RelValues.Up, helper); SetLinks(req, listContext.ElementType, parentRelType); SetExtensions(); SetHeader(listContext.IsListOfServices); }
public static ListRepresentation Create(ListContextSurface listContext, HttpRequestMessage req, RestControlFlags flags) { return(new ListRepresentation(listContext, req, flags)); }
private void SetChoices(ListContextSurface listContext, ParameterContextSurface paramContext, HttpRequestMessage req) { Choices = listContext.List.Select(c => RestUtils.GetChoiceValue(req, c, paramContext.Parameter, Flags)).ToArray(); }
private void SetChoices(ListContextSurface listContext, PropertyContextSurface propertyContext, HttpRequestMessage req) { Choices = listContext.List.Select(c => RestUtils.GetChoiceValue(req, c, propertyContext.Property, Flags)).ToArray(); }
public static Representation Create(ParameterContextSurface parmContext, ListContextSurface listContext, HttpRequestMessage req, RestControlFlags flags) { return(new PromptRepresentation(parmContext, listContext, req, flags)); }
public static PromptRepresentation Create(PropertyContextSurface propertyContext, ListContextSurface listContext, HttpRequestMessage req, RestControlFlags flags) { return(new PromptRepresentation(propertyContext, listContext, req, flags)); }