3

I have created a web service using ServiceStacks ServiceStack with Razor template. This service could be hosted in one of many locations. I want to be able to determine information about the uri of a given service. Here is my code -

    [Route("/Test")]
    public class Test : IReturn <TestResponse> {}

    public class TestResponse
        {
            public string something;
        }

    public class TestService : Service
        {
            public object Any(Test request)
                {
                    return new TestResponse() { something = base.Request.AbsoluteUri};
                }
        }

Whether I call this from a test or from typing it into my browser, base.Request always shows as null

1 Answer 1

4

base.Request isn't null, the issue is due to something being a public field instead of a public property.

Sign up to request clarification or add additional context in comments.

1 Comment

All I can say is DOH!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.