コード例 #1
0
 public ActionRepresentationStrategy(IOidStrategy oidStrategy, HttpRequestMessage req, ActionContextFacade actionContext, RestControlFlags flags)
     : base(oidStrategy, flags) {
     this.req = req;
     this.actionContext = actionContext;
     self = new MemberRelType(RelValues.Self, new UriMtHelper(oidStrategy, req, actionContext));
     parameterList = GetParameterList();
 }
コード例 #2
0
 protected MemberRepresentationStrategy(IOidStrategy oidStrategy, HttpRequestMessage req, PropertyContextFacade propertyContext, RestControlFlags flags)
     : base(oidStrategy ,flags) {
     this.req = req;
     this.propertyContext = propertyContext;
     objectUri = new UriMtHelper(oidStrategy ,req, propertyContext);
     self = new MemberRelType(RelValues.Self, new UriMtHelper(oidStrategy , req, propertyContext));
 }
コード例 #3
0
        private void SetLinks(HttpRequestMessage req, INakedObjectSpecificationSurface spec, RelType parentRelType) {
            var tempLinks = new List<LinkRepresentation> {
                LinkRepresentation.Create(parentRelType, Flags),
                LinkRepresentation.Create(SelfRelType, Flags)
            };

            if (Flags.FormalDomainModel) {
                tempLinks.Add(LinkRepresentation.Create(new DomainTypeRelType(RelValues.ElementType, new UriMtHelper(req, spec)), Flags));
            }

            Links = tempLinks.ToArray();
        }
コード例 #4
0
        private void SetLinks(HttpRequestMessage req, ITypeFacade spec, RelType parentRelType) {
            var tempLinks = new List<LinkRepresentation> {
                LinkRepresentation.Create(OidStrategy ,parentRelType, Flags),
                LinkRepresentation.Create(OidStrategy,SelfRelType, Flags)
            };

            if (Flags.FormalDomainModel) {
                tempLinks.Add(LinkRepresentation.Create(OidStrategy ,new DomainTypeRelType(RelValues.ElementType, new UriMtHelper(OidStrategy, req, spec)), Flags));
            }

            Links = tempLinks.ToArray();
        }
コード例 #5
0
        private void SetLinks(HttpRequestMessage req, PropertyContextSurface propertyContext, RelType parentRelType) {
            var tempLinks = new List<LinkRepresentation> {
                LinkRepresentation.Create(parentRelType, Flags),
                LinkRepresentation.Create(SelfRelType, Flags)
            };

            if (Flags.FormalDomainModel) {
                tempLinks.Add(LinkRepresentation.Create(new DomainTypeRelType(RelValues.ReturnType, new UriMtHelper(req, propertyContext.Property)), Flags));
                tempLinks.Add(LinkRepresentation.Create(new DomainTypeRelType(RelValues.ElementType, new UriMtHelper(req, propertyContext.Property.Specification)), Flags));
            }

            Links = tempLinks.ToArray();
        }
コード例 #6
0
 public static LinkRepresentation Create(RelType relType, RestControlFlags flags, params OptionalProperty[] properties) {
     return properties.Any() ? CreateWithOptionals<LinkRepresentation>(new object[] {relType, flags}, properties) : new LinkRepresentation(relType, flags);
 }
コード例 #7
0
 private void SetScalars(RelType relType) {
     Rel = relType.Name;
     Method = relType.Method.ToString().ToUpper();
     Type = relType.GetMediaType(Flags).ToString();
 }
コード例 #8
0
 protected LinkRepresentation(RelType relType, RestControlFlags flags) : base(relType, flags) {
     SetScalars(relType);
 }
コード例 #9
0
 public static RefValueRepresentation Create(RelType relType, RestControlFlags flags) {
     return new RefValueRepresentation(relType, flags);
 }
コード例 #10
0
 protected RefValueRepresentation(RelType relType, RestControlFlags flags)
     : base(flags) {
     Href = relType.GetUri().AbsoluteUri;
 }
コード例 #11
0
 protected LinkRepresentation(IOidStrategy oidStrategy, RelType relType, RestControlFlags flags)
     : base(oidStrategy ,relType, flags) {
     SetScalars(relType);
 }