Areas in different project with ASP.NET MVC 4 - asp.net-mvc-4

I am working with ASP.NET MVC 4, and trying to have areas in separate projects.
I have been checking this thread where we are anticipated the non-supporting state of areas in different projects after ASP.NET MVC2:
What are the pros and cons of Areas implemented as single projects vs multiple projects in asp.net mvc
Anyone know if it is true that it is not supported anymore?
Could anyone help me to find out if there is a common way to have areas in separated projects when using ASP.NET MVC 4?
I have found this other thread that may help, but was looking for a more common way:
ASP.NET MVC 4 Areas in separate projects not working (view not found)
Thank you!

The answer is most likely no, but I can't provide a definitive source as it concerns > version 3.
This was written in 2010:
I'm the development lead on ASP.NET MVC at Microsoft.
There are no plans to include multi-project areas in ASP.NET MVC 3.
However, it's definitely an area that we plan to revisit in the
future.
In the meantime MvcContrib's solutions are probably the best bet. The
MVC Futures download still includes an old (and perhaps only
semi-functional) version of the original multi-project areas feature.
Because the full source code for it is also available, you might be
able to construct a solution that is customized to your needs.
Currently, the areas template as provided in VS2013 does not provide an out of the box solution for this. My assumption would be that it is "possible" but not supported. The greater question would be, what scenario are you encountering where it is necessary to put your areas into different projects?

Different projects are like different sites in one solution. They do not depend on each others. Each Area has own routing registration.
You can check this. May be it will help:
ASP.NET MVC 4 Areas in separate projects

Related

.NET Core and Entity Framework

I was reading through some of the microsoft .net core documentation and stumbled across this page: https://learn.microsoft.com/en-us/aspnet/core/data/ef-mvc/
Does the following quoted text (more specifically the last bullet point) imply that the MVC approach is no longer the recommended approach moving forward? Is this just a microsoft thing or general for any development that was based on the MVC approach?
This tutorial teaches ASP.NET Core MVC and Entity Framework Core with
controllers and views. Razor Pages is a new alternative in ASP.NET
Core 2.0, a page-based programming model that makes building web UI
easier and more productive. We recommend the Razor Pages tutorial over
the MVC version. The Razor Pages tutorial:
Is easier to follow.
Provides more EF Core best practices.
Uses more efficient queries.
Is more current with the lastest API.
Covers more features.
Is the preferred approach for new application development.
Razor Pages are still MVC, they just greatly simplify your code. Rather than having a distinct Model in one directory, a Controller in another directory, and a View in yet another directory, it keeps everything together in two files: A "View" (.cshtml) and a "Controler/Model" (.cs).
If you look at enough ASP.NET MVC applications you quickly notice how often there is a 1:1 relationship between the Views and their Controllers. In most cases, you find the Controller contains one method per View that consists of little more than return View();. Razor Pages helps solve this issue.
This does not change the fundamental value proposition of MVC and it's clear separation of concerns. It also isn't an either/or proposition. You can absolutely mix the traditional MVC structure and Razor Pages in the same web app.

Choosing between dnx451 and dnxcore 50 for Azure Web App in terms of functionality, performance, etc

I am creating a new project that will run in Azure Web App on the new ASP.NET 5. We are not planning to run it on linux or anything like that, at least now. So the question is, should I try to keep both frameworks if possible just in case or I should prefer one of them. There are e.g. much less dependencies that I can use with dnxcore50 which is not so nice. So the main question is: are there any benefits of using dnxcore50 if running in Azure Web App, like: performance, stability, etc. over dnx451.
I have to start that I'm still the beginner in ASP.NET 5 (like the most other), so I didn't posted my answer before and you should ignore my reputation, because it's come from another subjects, which I know better.
I think that everybody, who switch to ASP.NET 5, ask the same question whether it does make sense to keep both framework in his projects. I try to post below my personal thoughts about the subject.
My personal choice is my short recommendation to you: keep both framework till you find some really important reason to drop one from there.
ASP.NET 5 is still not final. The strategy is not full fixed and it can be changed in a short time later. Just some examples. Previous beta versions have supported "Helios" as an option for hosting ASP.NET 5 applications on IIS. The option was dropped later (see the statement). Even the name dnxcore50 is renamed now to dotnet5.4 at least in all internal Microsoft components (see the announcement). One can suppose that some other things could be changed in the future. Thus I think that putting all your eggs in one basket would be too dangerous now: keeping of both frameworks could reduce the risk.
The next thing, which I found, was the following. dnxcore50 (dotnet5.4 or CoreFX or .NET Core foundational libraries) don't support many features supported by .Net Framework. One important example for me was missing XSD Schema validation (see here and here). I use XML only in combination with XSD Schema validation. I prefer JSON in the most other cases. Kipping of both frameworks in your project could helps you to locate the parts of your code, which could be not yet implemented in CoreFX. It could helps you to move the code in separate component or to change the implementation.
About the performance. One should distinguish potentiality of both frameworks from the current implementation. In general CoreFX was redesigned and decomposed. Many parts of one mscorlib was separated or removed (remoting, AppDomains and so on). It means that the performance of CoreFX should be better. Theoretically the factored API can provide better performance. Moreover one can more easy improve one parts of CoreFX and publish new version with improved performance. More modules instead of having one monolith gives us the new way for improvement of the performance and for fixing the bugs. On the other side replacing of dependencies to new version could be origin of new compatibility problems and thus it increases the risk and could decrease the stability. By keeping of both frameworks we can test whether the new problem exist in alternative framework. It allows us to suppose that the last changes of dependencies and not the last changes of our main code is the origin of new problems.
I can continue with pros and cons of the usage of every framework, but nodoby like to read long text and all my arguments forward me to the same practical decision: keeping by default of both frameworks in my projects as soon as I would find out a real requirement to drop one from the frameworks.
No major advantages really so far.
This might change in the future and why I'm planning to target both (CoreCLR and .NET 4.6). A lot of investment is being spent in CoreCLR but also on Docker and Service Fabric.
Just my 2 cents.

Social Networking Site in asp.net MVC with Entity Framework code first is better to choose this or another platform? how?

I want to start to develop my own social networking site in asp.net mvc with Entity framework code frist methodology (linq,back end ms sql server)...is it best choice to select this platform and why?
so, i will start to develop and also any info or link is there please send me??
No technology really does provide anything out-of-the-box. You can use MVC with entity framework but also ASP.NET with Linq to SQL (just as an example)
Either way you will have to build it from scratch if you do not want to use external controls. I would strictly recommend telerik (www.telerik.com) They offer great controls for mvc as well as for asp.net. But even if you use external controls you have to design the data/object-structure by yourself
There is no one true platform that is geared towards writing a social networking web application. Most have their advantages and disadvantages. If you are a .NET developer and you need to build something in RAD then use web forms, if you want to build something with separation and clean code in mind, use MVC.

nHibernate + Mvc3 Sample Application

I'm looking for a decent codebase that demonstrates how to use nHibernate as the persistance layer in an asp.net mvc3 project.
The two key pieces of understanding that I am looking to develop are
How to deal with ISession and
ISessionFactory.
How to implement the repository pattern without leaking any details of its nHibernate implemenation.
I'm aware of Sharp Architecture and reading through that now - Its interesting but I'm more keen on finding a straight-forward web app to pick apart than another framework to learn.
Thanks in advance.
I put together a project that offers an example of how to do this using nhibernate and asp.net mvc 2. The repository and nhibernate implementations will be almost the same. Probably the biggest change will be the ioc / dependency injection piece. Take a look. It should provide a solid starting point. Here is the URL.
http://gpsnerd.codeplex.com
Let me know if you have questions.
Bob
Take a look at https://bitbucket.org/FunnelWeb/dev
FunnelWeb is a blog engine based on ASP.NET MVC and NHibernate.
It is opensource and used by many bloggers/develoeprs

Can you point me to current examples using NHibernate in an ASP.NET MVC2 app?

Can anyone point me to any self-contained, complete, current reference materials/projects using NHibernate in an ASP.NET MVC2 application?
I have looked at Sharp Architecture, but I am not sure I need the complexity in that project. I certainly don't know enough about it to know if it is over-engineered for my purposes.
I would like to see more types of implementations to gauge the various ways people have skinned this cat.
This video series on nHibernate is great and they are using MVC Storefront as the base for the work:
http://www.tekpub.com/production/nhibernate
Code is here:
http://github.com/robconery/Kona
Another great MVC Resource (if you need one) is their MVC Videos:
http://www.tekpub.com/production/aspmvc
and
http://www.tekpub.com/production/byob
I can't recommend them enough.
Max Schilling
Gave it to Max for just answering. :)
But, for the record, here's additional apps to consider, should you end up here:
Sharp Architecture (the Northwind app
is okay but lean, not typical
enterprisey stuff)
Who Can Help Me? (great stuff and
kept up-to-date)
FubuMVC has good sample apps (based
on MVC not MVC2 at the time of this
post)
Thanks.