user820304
user820304

Reputation:

ServiceStack /views sub-folders

I have a View folder structure such as:

When I have the pages directly in my /Views/ folder, I can do the following:

public class HomeService : Service
{


[View("Home")]
    public object Any(Home request)
    {
        return new HomeResponse();
    }
}

Any ideas how to tell my Service to serve the views from a sub-folder? Even better if I can define some folder object, and be able to define my views as normal:

However when I have my views in a sub-folder, I cannot do the following:

public class HomeService : Service
{
    [View("Home/Home")]
    public object Any(Home request)
    {
        return new HomeResponse();
    }
}

Any idea how to get my Service to serve views from a sub-folder? Even better if I can define the folder seperately, and use:

[View("Home")]

Upvotes: 0

Views: 107

Answers (1)

mythz
mythz

Reputation: 143389

All View names inside ServiceStack /Views folder should be uniquely named (i.e. like Request DTO's). So inside the /Views folder it can be in any folder structure you like since they're all unique ServiceStack will just pick the view with the matching name.

Upvotes: 2

Related Questions