Esempio n. 1
0
        protected DomainTypeRepresentation(HttpRequestMessage req, INakedObjectSpecificationSurface spec, RestControlFlags flags) : base(flags)
        {
            var helper = new UriMtHelper(req, spec);

            SelfRelType = new DomainTypeRelType(RelValues.Self, helper);
            SetScalars(spec);
            SetLinks(helper);
            SetMembers(spec, req);
            SetTypeActions(spec, req);
            SetExtensions();
            SetHeader();
        }
        protected DomainTypeRepresentation(IOidStrategy oidStrategy, HttpRequestMessage req, ITypeFacade spec, RestControlFlags flags)
            : base(oidStrategy, flags)
        {
            var helper = new UriMtHelper(oidStrategy, req, spec);

            SelfRelType = new DomainTypeRelType(RelValues.Self, helper);
            SetScalars(spec);
            SetLinks(helper);
            SetMembers(spec, req);
            SetTypeActions(spec, req);
            SetExtensions();
            SetHeader();
        }
Esempio n. 3
0
        private void SetLinks(HttpRequest req, TypeActionInvokeContext context)
        {
            var uri = new DomainTypeRelType(new UriMtHelper(OidStrategy, req, context.OtherSpecification)).GetUri().AbsoluteUri;

            var tempLinks = new List <LinkRepresentation> {
                LinkRepresentation.Create(OidStrategy, SelfRelType,
                                          Flags,
                                          new OptionalProperty(JsonPropertyNames.Arguments,
                                                               MapRepresentation.Create(new OptionalProperty(context.ParameterId,
                                                                                                             MapRepresentation.Create(new OptionalProperty(JsonPropertyNames.Href,
                                                                                                                                                           uri))))))
            };

            Links = tempLinks.ToArray();
        }