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();
 }
 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));
 }
Exemple #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();
        }
        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();
        }
Exemple #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();
        }
Exemple #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);
 }
Exemple #7
0
 private void SetScalars(RelType relType) {
     Rel = relType.Name;
     Method = relType.Method.ToString().ToUpper();
     Type = relType.GetMediaType(Flags).ToString();
 }
Exemple #8
0
 protected LinkRepresentation(RelType relType, RestControlFlags flags) : base(relType, flags) {
     SetScalars(relType);
 }
Exemple #9
0
 public static RefValueRepresentation Create(RelType relType, RestControlFlags flags) {
     return new RefValueRepresentation(relType, flags);
 }
Exemple #10
0
 protected RefValueRepresentation(RelType relType, RestControlFlags flags)
     : base(flags) {
     Href = relType.GetUri().AbsoluteUri;
 }
 protected LinkRepresentation(IOidStrategy oidStrategy, RelType relType, RestControlFlags flags)
     : base(oidStrategy ,relType, flags) {
     SetScalars(relType);
 }