예제 #1
0
 /// <summary>
 /// HTTP resource defined by a GET delegate method.
 /// </summary>
 /// <param name="ResourceName">Name of resource.</param>
 /// <param name="GET">GET Method.</param>
 /// <param name="Synchronous">If the resource is synchronous (i.e. returns a response in the method handler), or if it is asynchronous
 /// (i.e. sends the response from another thread).</param>
 /// <param name="HandlesSubPaths">If sub-paths are handled.</param>
 /// <param name="UserSessions">If the resource uses user sessions.</param>
 /// <param name="AuthenticationSchemes">Any authentication schemes used to authenticate users before access is granted.</param>
 public HttpGetDelegateResource(string ResourceName, HttpMethodHandler GET, bool Synchronous, bool HandlesSubPaths,
                                bool UserSessions, params HttpAuthenticationScheme[] AuthenticationSchemes)
     : base(ResourceName)
 {
     this.get                   = GET;
     this.synchronous           = Synchronous;
     this.handlesSubPaths       = HandlesSubPaths;
     this.authenticationSchemes = AuthenticationSchemes;
     this.userSessions          = UserSessions;
 }
예제 #2
0
        public void Initialize()
        {
            _person = new Person
            {
                Id        = Guid.Parse("7AEC12CD-FD43-49DD-A2AB-3CDD19A3A5F4"),
                Birthday  = new DateTimeOffset(new DateTime(1980, 1, 1)),
                Firstname = "John",
                Lastname  = "Doe"
            };

            _handler          = new HttpMethodHandler();
            _registrationMock = new Mock <IHateoasRegistration <Person> >();
            _linkBuilderMock  = new Mock <ILinkBuilder>(MockBehavior.Strict);
        }
 /// <summary>
 /// HTTP resource defined by GET and POST delegate methods.
 /// </summary>
 /// <param name="ResourceName">Name of resource.</param>
 /// <param name="GET">GET Method.</param>
 /// <param name="POST">POST Method.</param>
 /// <param name="Synchronous">If the resource is synchronous (i.e. returns a response in the method handler), or if it is asynchronous
 /// (i.e. sends the response from another thread).</param>
 /// <param name="HandlesSubPaths">If sub-paths are handled.</param>
 /// <param name="UserSessions">If the resource uses user sessions.</param>
 /// <param name="AuthenticationSchemes">Any authentication schemes used to authenticate users before access is granted.</param>
 public HttpGetPostDelegateResource(string ResourceName, HttpMethodHandler GET, HttpMethodHandler POST, bool Synchronous, bool HandlesSubPaths,
                                    bool UserSessions, params HttpAuthenticationScheme[] AuthenticationSchemes)
     : base(ResourceName, GET, Synchronous, HandlesSubPaths, UserSessions, AuthenticationSchemes)
 {
     this.post = POST;
 }