コード例 #1
0
 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);
 }
コード例 #2
0
 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();
     };
 }
コード例 #3
0
 public RestSnapshot(ListContextSurface listContext, HttpRequestMessage req, RestControlFlags flags)
     : this(req, true) {
     logger.DebugFormat("RestSnapshot:ServicesList");
     populator = () => {
         representation = ListRepresentation.Create(listContext, req, flags);
         SetHeaders();
     };
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 public static ListRepresentation Create(ListContextSurface listContext, HttpRequestMessage req, RestControlFlags flags) {
     return new ListRepresentation(listContext, req, flags);
 }
コード例 #7
0
 public static Representation Create(ParameterContextSurface parmContext, ListContextSurface listContext, HttpRequestMessage req, RestControlFlags flags) {
     return new PromptRepresentation(parmContext, listContext, req, flags);
 }
コード例 #8
0
 public static PromptRepresentation Create(PropertyContextSurface propertyContext, ListContextSurface listContext, HttpRequestMessage req, RestControlFlags flags) {
     return new PromptRepresentation(propertyContext, listContext, req, flags);
 }
コード例 #9
0
 private void SetChoices(ListContextSurface listContext, ParameterContextSurface paramContext, HttpRequestMessage req) {
     Choices = listContext.List.Select(c => RestUtils.GetChoiceValue(req, c, paramContext.Parameter, Flags)).ToArray();
 }
コード例 #10
0
 private void SetChoices(ListContextSurface listContext, PropertyContextSurface propertyContext, HttpRequestMessage req) {
     Choices = listContext.List.Select(c => RestUtils.GetChoiceValue(req, c, propertyContext.Property, Flags)).ToArray();
 }