public RestSnapshot(IOidStrategy oidStrategy, ListContextFacade listContext, HttpRequestMessage req, RestControlFlags flags) : this(oidStrategy, req, true) { populator = () => { Representation = ListRepresentation.Create(oidStrategy, listContext, req, flags); SetHeaders(); }; }
protected ListRepresentation(IOidStrategy oidStrategy, ListContextFacade listContext, HttpRequestMessage req, RestControlFlags flags) : base(oidStrategy, flags) { Value = listContext.List.Select(c => CreateObjectLink(oidStrategy, req, c)).ToArray(); SelfRelType = new ListRelType(RelValues.Self, SegmentValues.Services, new UriMtHelper(oidStrategy, req, listContext.ElementType)); SetLinks(req); SetExtensions(); SetHeader(listContext.IsListOfServices); }
public RestSnapshot(IOidStrategy oidStrategy, PropertyContextFacade propertyContext, ListContextFacade listContext, HttpRequestMessage req, RestControlFlags flags) : this(oidStrategy,req, true) { logger.DebugFormat("RestSnapshot:propertyprompt"); populator = () => { representation = PromptRepresentation.Create(oidStrategy ,propertyContext, listContext, req, flags); SetHeaders(); }; }
protected PromptRepresentation(IOidStrategy oidStrategy, PropertyContextFacade propertyContext, ListContextFacade listContext, HttpRequestMessage req, RestControlFlags flags) : base(oidStrategy, flags) { SetScalars(propertyContext.Property.Id); SetChoices(listContext, propertyContext, req); SelfRelType = new PromptRelType(RelValues.Self, new UriMtHelper(oidStrategy,req, propertyContext)); SetLinks(req, listContext.ElementType, new ObjectRelType(RelValues.Up, new UriMtHelper(oidStrategy,req, propertyContext.Target))); SetExtensions(); SetHeader(listContext.IsListOfServices); }
protected PromptRepresentation(IOidStrategy oidStrategy, ParameterContextFacade parmContext, ListContextFacade listContext, HttpRequestMessage req, RestControlFlags flags) : base(oidStrategy, flags) { SetScalars(parmContext.Id); SetChoices(listContext, parmContext, req); SelfRelType = new PromptRelType(RelValues.Self, new UriMtHelper(oidStrategy ,req, parmContext)); var helper = new UriMtHelper(oidStrategy,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(IOidStrategy oidStrategy, ListContextFacade listContext, HttpRequestMessage req, RestControlFlags flags) { return new ListRepresentation(oidStrategy, listContext, req, flags); }
public static Representation Create(IOidStrategy oidStrategy, ParameterContextFacade parmContext, ListContextFacade listContext, HttpRequestMessage req, RestControlFlags flags) { return new PromptRepresentation(oidStrategy ,parmContext, listContext, req, flags); }
private void SetChoices(ListContextFacade listContext, ParameterContextFacade paramContext, HttpRequestMessage req) { Choices = listContext.List.Select(c => RestUtils.GetChoiceValue(OidStrategy,req, c, paramContext.Parameter, Flags)).ToArray(); }