clean-architecture-in-asp-net-mvc-5 | source sample project | Architecture library
kandi X-RAY | clean-architecture-in-asp-net-mvc-5 Summary
kandi X-RAY | clean-architecture-in-asp-net-mvc-5 Summary
Clean Architecture in ASP.NET MVC 5.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of clean-architecture-in-asp-net-mvc-5
clean-architecture-in-asp-net-mvc-5 Key Features
clean-architecture-in-asp-net-mvc-5 Examples and Code Snippets
Community Discussions
Trending Discussions on clean-architecture-in-asp-net-mvc-5
QUESTION
I am working with orchard. writing such a project is my dream!.. so i started a research a bout that. which interested me about orchard, is while orchard is mvc project but why it doesn't have any model , view and controller in his web layer solution? does it use CleanArchitecture
or some specific architecture like this ?
i tried to know about this case in orchards documents but i didn't find any description about it.
...ANSWER
Answered 2017-Feb-23 at 03:00Actually, Orchard being an MVC based project, it intrinsically does have models, views and controllers. But it provides much more than that.
The key thing to understand, in my mind, is that at the very core, requests are handled by a given controller, which builds a model, and returns a view that uses this model. What Orchard adds to that is how it builds up a particular model, and how it selects the view to display that model.
Consider requesting a content item by navigating to, say, a content item with alias "/about".
What happens is that the ASP.NET routing will kick in, which has been configured to match against aliases of all content items. The route for "/about" will be found, which is handled by the ItemController of the Contents module (modules in Orchard are conceptually the same as MVC areas). The ItemController will build a dynamic model for the requested content item, which is called a shape. The shape is an instance of the Shape class, which contains metadata about the shape, such as the name of the shape. Based on this information, Orchard leverages the view engine to select the appropriate Razor view to render the shape object.
So you see, all of the basic MVC stuff comes into play. Orchard simply adds a powerful infrastructure on top of it to provide an advanced and flexible rendering system, like turning content items into shapes, which are then turned into HTML via the view engine. But at the end of the day, it's primarily about controllers creating models used by views.
QUESTION
I setup my MVC 5 site by category, then controller, model, view sub-folders in each category, i.e. root folder folders \Home and \Products would have these three sub-folders as well as a root \Shared\Views folder. I followed a terrific article my Matthew Renz, Clean Architecture in ASP.NET MVC 5. Done in part by creating a custom RazorViewEngine, specifically:
...ANSWER
Answered 2017-Jan-31 at 18:44These are placeholders in the string that can be used to put the area name, controller name or action name into the string by the controller. {2} is area, {1} is controller,{0} is the action.
You may also be interested to know that when using Asp.Net Core it's easy to get the standard Razor View Engine to locate views and such in custom locations via a ViewLocationExpander
rather than needing to create a new view engine that inherits from the Razor View Engine. I only mention this because you added the asp.net-core-mvc tag on your question.
Here is a stack overflow answer that shows how: How to specify the view location in asp.net core mvc when using custom locations?
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install clean-architecture-in-asp-net-mvc-5
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page