private static RefValueRepresentation CreateObjectRef(IOidStrategy oidStrategy, HttpRequest req, IObjectFacade no, RestControlFlags flags) { var helper = new UriMtHelper(oidStrategy, req, no); var rt = new ObjectRelType(RelValues.Element, helper); return(RefValueRepresentation.Create(oidStrategy, rt, flags)); }
private LinkRepresentation CreateObjectLink(IOidStrategy oidStrategy, HttpRequestMessage req, IObjectFacade no) { var helper = new UriMtHelper(oidStrategy, req, no); ObjectRelType rt = no.Specification.IsService ? new ServiceRelType(helper) : new ObjectRelType(RelValues.Element, helper); return(LinkRepresentation.Create(oidStrategy, rt, Flags, new OptionalProperty(JsonPropertyNames.Title, RestUtils.SafeGetTitle(no)))); }
private LinkRepresentation CreateUpLink() { var helper = new UriMtHelper(OidStrategy, req, actionContext.Target); ObjectRelType parentRelType = actionContext.Target.Specification.IsService ? new ServiceRelType(RelValues.Up, helper) : new ObjectRelType(RelValues.Up, helper); return(LinkRepresentation.Create(OidStrategy, parentRelType, Flags)); }
private LinkRepresentation CreateObjectLink(HttpRequestMessage req, INakedObjectSurface no) { var helper = new UriMtHelper(req, no); ObjectRelType rt = no.Specification.IsService() ? new ServiceRelType(helper) : new ObjectRelType(RelValues.Element, helper); return(LinkRepresentation.Create(rt, Flags, new OptionalProperty(JsonPropertyNames.Title, RestUtils.SafeGetTitle(no)))); }
protected PromptRepresentation(IOidStrategy oidStrategy, ParameterContextFacade parmContext, HttpRequestMessage req, RestControlFlags flags) : base(oidStrategy, flags) { SetScalars(parmContext.Id); SetChoices(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, parmContext.Completions.ElementType, parentRelType); SetExtensions(); SetHeader(parmContext.Completions.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); }