6

I want to have many projects(like 20) in one ASP.NET solution. All projects would have their own databases, models, views and controllers. Can you tell me how I can do that? And how the urls would be? If there is one project in the solution it is like this :

localhost:12345/Controller/View

When there are more projects, would the correct configuration like this ? :

localhost:12345/ProjectName/Controller/View

One more thing, I am planning to use Identity 2.0 Framework. Is it possible for a user to be logged in in all projects when he logs in once? Thanks.

2 Answers 2

5

Can you tell me how I can do that? And how the urls would be?

You can have 'n' number of projects in your solution. You need to handle it using the RouteConfig.cs where if you have three projects as 'Project1', 'Project2' and 'Project3'. Then your respective route config would be something like below:

routes.MapRoute(
    name: "Default_1",
    url: "Project1/{controller}/{action}/{id}",
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);

Similarly,

routes.MapRoute(
    name: "Default_2",
    url: "Project2/{controller}/{action}/{id}",
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);

Is it possible for a user to be logged in in all projects when he logs in once?

Yes, it is definetly possible. But ASP.NET Identity out of the box does not support multiple applications.Having said that it's the developers task to achieve it thru Single Sign On

Link : How to implement it

Hope it helps!

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

Comments

2

You can have as many projects in a single solution you want. Just right click on the solution in the Project Explorer window and select Add New Project. In the properties of each project, set its root directory to be /applicationname.

You would need to look into the details of oAuth to implement a single sign on scheme, and I can't really help you there, but that is the whole purpose behind that implementation, so it is definitely possible.

Comments

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.