The ASP.NET MVC Framework is a Microsoft web application framework that implements the model-view-controller (MVC) pattern.

learn more… | top users | synonyms

1
vote
2answers
2k views

Anemic Domain Model vs. DDD by definition example(s)?

What is an example of "Business Logic" that should reside in the DomainModel i.e. inside an Entity instead of inside a (Domain) Service, as well as some example logic that should be in a service. ...
2
votes
1answer
731 views

DDD/SOA in (.NET) MVC and Message pattern(s) / Request Response

We're currently considering whether it makes sense (or if the benefits are worth the added code) to introduce a Message based pattern (such as Request Response) into a Domain Driven Design / Service ...
1
vote
2answers
237 views

The Proper UML Model of a System for Non-Technical Boss

I've taken on some side work for this non-profit and last week was my first week on the job. They have two SQL Server Databases each with many tables in them that represent over 20 different ...
1
vote
1answer
646 views

How do I split out a service layer

I currently have four projects in my website's solution: Project.Data This holds the EntityFramework DbContext object and also the Repositories that interact with it. It references Project.Models. ...
3
votes
1answer
126 views

MVC URL formatting/design

In refactoring a lot of MVC code, I have run into an issue with my URL design. For example, let's say we have a Venue object public class Venue { public long ID { get; set; } public ...
5
votes
3answers
1k views

Versioning an API

I'm starting a side project, the first stage will be a building a web application with MVC, in later stages we will be adding clients for mobile platforms. My thought was to create one API that all of ...
2
votes
2answers
647 views

MVC : Does Code to save data in cache or session belongs in controller?

I'm a bit confused if saving the information to session code below, belongs in the controller action as shown below or should it be part of my Model? I would add that I have other controller methods ...
4
votes
6answers
388 views

Is MVC ever considered/applied system-wide?

I was having a discussion with a colleague and he bought up the topic of MVC and the use of ViewModels in ASP.NET MVC. The discussion was that, in an n-layer architecture, the UI, Business Layer and ...
6
votes
6answers
2k views

How do I make my ASP.NET application take an action based on time?

I have an ASP.NET MVC4 application. Suppose that I wanted to execute some code (such as emailing a user) 2 days after a user has signed up. One way is to have code executed on every request which ...
9
votes
4answers
795 views

In Unit Testing, why would I create a Repository twice?

The other day I was reading a little about Unit Testing and I saw some examples where people create a repository interface (i.e. IExampleRepository) and then create the real repository (public class ...
8
votes
3answers
7k views

Why should I use List<T> over IEnumerable<T>?

In my ASP.net MVC4 web application I use IEnumerables, trying to follow the mantra to program to the interface, not the implementation. Return IEnumerable(Of Student) vs Return New List(Of ...
9
votes
4answers
2k views

What's the best practice for naming uploaded images?

Suppose I have a form in my web application where users can upload a profile picture. I've got few requirements about file size, dimensions etc, but when the user uploads the image, how should I name ...
2
votes
4answers
699 views

Querystring Advanced Search where there are about 20 search fields

I am creating an advanced search page where there are about 20 search fields for a user to filter their search. My question deals with the query string, Is it standard web development practice to have ...
3
votes
3answers
2k views

Reuse MVC4 codebase / deploy MVC4 as standalone desktop application?

We have an MVC4 application that we would also need to distribute as a standalone (no network connectivity) desktop application. Rather than rebuild the HTML/JS front-end we would like to reuse that ...
1
vote
0answers
235 views

Reusing values for segment variables when generating outbound URLs

When routes are matched to the outbound URLs, the routing system will try to find values for each of the segment variables in route's URL pattern by also looking at the values from the current ...
1
vote
2answers
2k views

Asp MVC section and partial views

I have a question regarding ASP sections and partial views. What ser the benefit of using one over another? Because if I have a menu, i guest that it could be both as a section, but also as a ...
6
votes
2answers
590 views

Why is using named routes for generating outbound URLs a violation of Separation of Concerns?

What is separation of concerns? In computer science, separation of concerns (SoC) is the process of breaking a computer program into distinct features that overlap in functionality as little ...
0
votes
1answer
206 views

Streamlining ASP.Net MVC deployment? [closed]

I own a VPS with Windows Server 2012 on it. I can install whatever I want on it. In the past when deploying an ASP.Net MVC project, I would right click the project in the solution and Publish it. I ...
13
votes
3answers
3k views

Is there any real value in unit testing a controller in ASP.NET MVC?

I hope this question gives some interesting answers because it's one that's bugged me for a while. Is there any real value in unit testing a controller in ASP.NET MVC? What I mean by that is, most ...
1
vote
1answer
375 views

UTF-16 Pitfalls, Chinese

I'm going to be writing an application that is pure HTML5 and JS and MVC.net back-end. We have .resx files that are getting compiled to .js files for resources in the html5 application. The ...
4
votes
2answers
550 views

How do I handle having so many SQL queries?

I have an MVC3 project that uses SQL Server. I use data from the SQL database all the time and I often find that I'm reusing/duplicating some SQL queries. I thought I'd solve this problem by creating ...
0
votes
3answers
336 views

Re-engineering an ASP.NET AJAX project as ASP MVC

I have been asked to investigate the possibility of re-engineering an existing ASP.NET AJAX Web Application as under MVC. The project, as it stands ATM, is very heavily relient on Telerik's ASP.NET ...
0
votes
1answer
432 views

Implementing a Service Layer with MVC4 while honoring Single Responsibility

I'm trying to learn some best practices while I ramp up on MVC4. I have a solution with three projects: Web: MVC stuff Core: Data Model Tests: Testing classes I'm now trying to add: Services: ...
34
votes
1answer
2k views

Why does the .Net world seem to embrace magic strings instead of staticly typed alternatives?

So, I work in .Net. I make open source projects in .Net. One of my biggest problems with it isn't necessariyl with .Net, but with the community and frameworks around it. It seems everywhere that ...
0
votes
2answers
310 views

Which asp.net technology fits this situation best?

I think I can count WebAPI out, but WebForms, WebPages, and MVC are all possibilities. I want to create an asp.net web site that is primarily static content and links to other sites. The only ...
3
votes
2answers
833 views

What .NET objects should I use to create a cookie based session in MVC?

I'm writing a custom password reset application that uses a validation technique that doesn't fit cleanly with ASP.NET Membership Provider's challenge questions. Namely I need to invoke a workflow ...
3
votes
5answers
1k views

MVC exposes database primary keys?

I'm going through a MVC tutorial, and I notice that convention seems to be to expose a tables primary key on detail pages/urls (ie. /Movies/Details/5 as an example from the tutorial). It's obviously ...
7
votes
3answers
5k views

How to make an ASP.NET MVC site modular

I'm in the planning stage for an employee intranet system to be built with ASP.NET MVC 4. We'd like the site to consist of separate "modules", each of which provides a different feature: messaging, ...
1
vote
1answer
573 views

MVC 3 Page design; split pages into Many partials?

I am currently working on an MVC 3 Web app project where I need to display a lot of information on the front page. I am relatively new at web page layout and design so I have hit a wall in terms of ...
2
votes
1answer
659 views

Newbie ASP.NET developer being forced into MVC4 with WebForms

I recently got hired on as a new ASP.NET developer (C# code behind). When I arrived, I was told that they were moving to MVC 4, and so I bought two books on that. However, the other day I learned ...
3
votes
4answers
4k views

What does this mean: Expression<Func<TModel, TValue>>

In ASP.Net MVC, in the razor view, you can type this kind of code: @Html.EditorFor(model => model.Name) (in this case, it creates a textbox for the field Name of the object which is defined as ...
1
vote
2answers
402 views

Want some architecture input to help with current requirements and future (unknown) requirements :-)

BACKGROUND: I am starting to architect a web project using asp.net mvc. I'm going to use a very common architecture where I have the following layers: Service Biz Data Domain The Service layer ...
2
votes
2answers
308 views

Different Project Type in a Single Website

I have developed a website in asp.net and I have some additional tasks, improvements to develop. In order to get experience in asp.net/mvc, I want to create an admin panel using asp.net mvc. Is this ...
3
votes
1answer
852 views

How to create view models - Constructor, Factory Method, …?

I'm trying to lead a charge for re factoring our rather bloated controllers. We currently have a BaseModel from which all our other models inherit. The BaseModel contains things common to all pages, ...
1
vote
1answer
150 views

Good resources for a MVC.Net developer going back to WebForms? [closed]

Well it looks like I may be forced to build a new system in webforms after having worked exclusively in MVC for the last 3 years. Initially I didnt think this was going to be a problem except the ...
3
votes
2answers
1k views

Different database for Membership and our web data or use just one?

Is better to keep our Membership stuff on the DefaultConnection and create another connection (another database) for our data? Or just one database for all? If I have a MyAppContext and I want ...
38
votes
6answers
22k views

Why shouldn't I use the repository pattern with Entity Framework?

During a job interview, I was asked to explain why the repository pattern isn't a good pattern to work with ORMs like Entity Framework. Why is this the case?
0
votes
1answer
344 views

Get/Post Controller Logic Best Practice

In an ASP.NET MVC project (Razor), I have a Get request, which loads two properties on a model, dependent on the property passed into the action method. So if the parameter has a value, the Group ...
1
vote
2answers
682 views

Implement service layer in MVC

We have a defined service layer hosted in WCF. We are now building a website that will need to use the services functionality. The website is being written in ASP.NET MVC 4 and I'm trying to decide ...
2
votes
1answer
192 views

Is passing the Model around in this way considered bad practice?

If I have a view called, for example, ViewDetails that displays user information in labels and has a Model called ViewDetailsModel and if I want to allow the user to click a button to edit some of ...
1
vote
1answer
243 views

Unit test: How best to provide an XML input?

I need to write a unit test which validates the serialization of two attributes of an XML(size ~ 30 KB) file. What is the best way to provide an input for this test? Here are the options I have ...
5
votes
1answer
1k views

Project/DLL separation of concerns in ASP.NET MVC

I'm coming from a web forms n-tier background into ASP.NET MVC projects, and I'm wondering what the best practices are for separation of the components of MVC into different libraries (or not to) in ...
0
votes
2answers
592 views

MVC or Extract Service Layer

we have an application that is built with .Net MVC. We are now tasked with exposing API's to third parties. Members on our team want to just continue down our current path and just use more ...
3
votes
1answer
2k views

ASP.NET MVC Portable Areas - Can they communicate and be used as a plugin-like architecture?

I'll get straight to the point: I was wondering if there is a common pattern to use portable areas as a components of a plugin-like architecture. Example: We've got 3 plugins (portable areas) ...
2
votes
1answer
2k views

Modular enterprise architecture using MVC and Orchard CMS

I'm making a large scale MVC application using Orchard. And I'm going to be separating my logic into modules. I'm also trying to heavily decouple the application for maximum extensibility and ...
9
votes
3answers
3k views

How should I implement the repository pattern for complex object models?

Our data model has almost 200 classes that can be separated out into about a dozen functional areas. It would have been nice to use domains, but the separation isn't that clean and we can't change it. ...
2
votes
1answer
502 views

ASP.Net MVC 3: multiple versions of the site without changing of URL, is it possible?

Our website is written in ASP.NET MVC 3 and we want to change a feature in the core functionality of the site. The problem is not every client can be moved to this new version/format (because of ...
2
votes
1answer
1k views

.Net C# Remote Method Invocation (RMI) (Client/Server communication)

What exactly is C# version of Java RMI? I want to invoke the methods of client from the server, ping the client from server etc. How the server and client communication is done with c#?
1
vote
2answers
221 views

Is it better to define all routes in the Global.asax than to define separately in the areas?

I am working on a MVC 4 project that will serve as an API layer of a larger application. The developers that came before me set up separate Areas to separate different API requests (i.e Search, ...
4
votes
2answers
589 views

Is ASP.NET MVC completely (and exclusively) based on conventions?

--TL;DR Is there a "Hello World!" ASP.NET MVC tutorial out there that doesn't rely on conventions and "stock" projects? Is it even possible to take advantage of the technology without reusing the ...