Exemplo n.º 1
0
        private Uri GetTransientObjectMemberUri(IMemberFacade member, string memberType)
        {
            CheckArgumentNotNull(CachedType, "object type");
            CheckArgumentNotNull(memberType, "member type");

            var template = new UriTemplate(SegmentValues.Objects + "/{objectType}/{memberType}/{memberId}");

            return(template.BindByPosition(prefix, CachedType, memberType, member.Id));
        }
Exemplo n.º 2
0
        private Uri GetServiceMemberUri(IMemberFacade member, string memberType)
        {
            CheckArgumentNotNull(CachedType, "service type");
            CheckArgumentNotNull(memberType, "member type");
            CheckArgumentNotNull(member.Id, "member id");

            var template = new UriTemplate(SegmentValues.Services + "/{id}/{memberType}/{memberId}");

            return(template.BindByPosition(prefix, CachedType, memberType, member.Id));
        }
        public string GetRelParametersFor(IMemberFacade memberFacade)
        {
            if (memberFacade is IActionFacade)
            {
                return(FormatParameter(RelParamValues.Action, memberFacade.Id) + (param == null ? "" : FormatParameter(RelParamValues.Param, param.Id)));
            }

            var associationFacade = memberFacade as IAssociationFacade;

            if (associationFacade != null)
            {
                return(FormatParameter(associationFacade.IsCollection ? RelParamValues.Collection : RelParamValues.Property, associationFacade.Id));
            }

            throw new ArgumentException("Unexpected type:" + memberFacade.GetType());
        }
Exemplo n.º 4
0
 public ChoiceRelType(IAssociationFacade property, UriMtHelper helper) : this(helper) {
     member = property;
 }
 private Uri GetMemberUri(IMemberFacade member, string memberType)
 {
     return(spec.IsService ? GetServiceMemberUri(member, memberType) : GetObjectMemberUri(member, memberType));
 }
 public SimpleAuthorizationServerProvider(IMemberFacade facade)
 {
     _facade = facade;
 }
Exemplo n.º 7
0
        public string GetRelParametersFor(IMemberFacade memberFacade) {
            if (memberFacade is IActionFacade) {
                return FormatParameter(RelParamValues.Action, memberFacade.Id) + (param == null ? "" : FormatParameter(RelParamValues.Param, param.Id));
            }

            var associationFacade = memberFacade as IAssociationFacade;
            if (associationFacade != null) {
                return FormatParameter(associationFacade.IsCollection ? RelParamValues.Collection : RelParamValues.Property, associationFacade.Id);
            }

            throw new ArgumentException("Unexpected type:" + memberFacade.GetType());
        }
Exemplo n.º 8
0
 private Uri GetMemberUri(IMemberFacade member, string memberType) {
     return spec.IsService ? GetServiceMemberUri(member, memberType) : GetObjectMemberUri(member, memberType);
 }
Exemplo n.º 9
0
        private Uri GetObjectMemberUri(IMemberFacade member, string memberType) {
            CheckArgumentNotNull(CachedType, "object type");
            CheckArgumentNotNull(memberType, "member type");
            CheckArgumentNotNull(member.Id, "member id");


            var template = new UriTemplate(SegmentValues.Objects + "/{objectType}/{objectId}/{memberType}/{memberId}");
            return template.BindByPosition(prefix, CachedType, cachedId, memberType, member.Id);
        }
Exemplo n.º 10
0
        private Uri GetServiceMemberUri(IMemberFacade member, string memberType) {
            CheckArgumentNotNull(CachedType, "service type");
            CheckArgumentNotNull(memberType, "member type");
            CheckArgumentNotNull(member.Id, "member id");


            var template = new UriTemplate(SegmentValues.Services + "/{id}/{memberType}/{memberId}");
            return template.BindByPosition(prefix, CachedType, memberType, member.Id);
        }
Exemplo n.º 11
0
 public ChoiceRelType(IAssociationFacade property, UriMtHelper helper) : this(helper) {
     member = property;
 }
Exemplo n.º 12
0
 private Uri GetObjectMemberUri(IMemberFacade member, string memberType)
 {
     return(string.IsNullOrEmpty(cachedId) ? GetTransientObjectMemberUri(member, memberType) : GetPersistentObjectMemberUri(member, memberType));
 }
 private Uri GetObjectMemberUri(IMemberFacade member, string memberType) {
     return string.IsNullOrEmpty(cachedId) ? GetTransientObjectMemberUri(member, memberType) : GetPersistentObjectMemberUri(member, memberType);
 }
Exemplo n.º 14
0
 public AccountController(IMemberFacade facade)
 {
     _facade = facade;
 }