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
1answer
164 views

Should arguments always be passed to an Action in a MVC controller?

I have a number of controllers that take a 'site' as a parameter within their actions, like so: [AuthoriseSite] public ActionResult Index(string site) { var model = ...
1
vote
1answer
40 views

Data Structure for Form or Survey

I am planning an app which allows users to complete surveys/forms. I'm having trouble planning the data schema for the forms. I really want to have a data structure which can be mostly automatically ...
0
votes
0answers
47 views

Implementing a one way web request/response in .NET

What is the better way to implement a request/response in .NET when dealing with just getting an xml web resource for the external source and process it to your system? By the way, to access this xml ...
0
votes
0answers
30 views

Azure Active Directory

I am developing a suite of applications that will be hosted in Azure. Some apps will be for customer use (not public tho, i.e. invited/paid up customers) and some for internal employees. For ...
1
vote
1answer
681 views

How to test model binding within an MVC controller when Bind attribute with Include list is used?

Auto-generated action methods in MVC5 make use of the BindAttribute with an Include list that contains the field names in a string literal. Example: // POST: MyTable/Edit/5 // To protect from ...
1
vote
1answer
119 views

Organizing action in MVC controller

I am developing an ASP.NET MVC application, that has a lot of client side interaction ie. a lot of ajax calls to controller actions. Currently I have controllers containing actions (part of the same ...
0
votes
2answers
512 views

block access to area/controller's methods but allow inherited controller to run methods, asp .net mvc5

I am trying to find out how to block a whole area/controller from being accessed by typing url website.com/area1/basecontroller/method1 (this area also contains the views that will be displayed) , ...
0
votes
0answers
105 views

Is this approach scalable?

I am working to rewrite a legacy application (C++) to C# ASP.NET MVC with EF6 but plan to upgrade to ASP.NET Core1 and EF Core 1. The database schema is really arcane in that it has a single schema ...
5
votes
1answer
318 views

Does unused code affects the assembly after startup (Memory for example)?

Disclaimer: I come from a PHP background. In PHP, I could have thousands files, which are never loaded, if not needed, due to the autoloader feature (If some code is needed, it would be loaded) How ...
2
votes
1answer
78 views

ASP.NET MVC Middle tier object naming

As a corporate developer who works alone I find myself creating and writing a lot of websites that consist of screens that are basically wrappers for a DB table. So for instance on a screen that ...
1
vote
1answer
40 views

Where does apply authorization rules for my layered application?

This question is about applying rules of my application that confuse me. My controller is using service and the service is using repository. public class CommentController: ApiController{ ...
87
votes
9answers
51k 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?
2
votes
0answers
49 views

Log with Application Insights only (NLog vs AI) in Asp MVC

I was going through several blog posts and stackoverflow and programmers and I am still a bit confused. You can install NLog (or some other logging lib) and start logging quite fast and then you can ...
2
votes
0answers
103 views

Architecture for Web application to monitor remote servers

So I'm a relatively new programmer, attempting to create a web application (ASP.net) to display the system information (E.G. Status of windows services, disk & resource usage and errors in event ...
1
vote
2answers
58 views

Single Class to Serve as View Model as well as Container for Submitted Form

I see the following design in the code which is part of the default web application project in visual studio: A single data model class in constructed and decorated with various data validation ...
2
votes
3answers
182 views

Updating particular properties of EF objects every X amount of days in MVC

I'm building an MVC ASP.NET IMDb-like website which presents various information about movies to users, relying on 3rd party APIs to (initially) fetch movie info. The IDs representing each movie on ...
5
votes
2answers
197 views

Best approach for managing users that are defined inside the active directory, inside my custom application

I want to start a new asp.net mvc5 Personal Appraisals web project. Now I will have a module inside the system for managing users, and adding info such as primary role, secondary role, main skills, ...
1
vote
1answer
506 views

.NET MVC authentication to AngularJS to .NET web API advice needed

So i am inheriting a team and a large project that should have been built with a restful back end. For the time it is only reporting and we all agree to build out a web API (separate project) with ...
3
votes
1answer
98 views

Mapping Domain models to ViewModel

I have an Asp.net MVC5 application structured like this: Core Domain project Infrastructure DAL project Utilities UI UI project (contains ViewModel at the moment, will probably put that ...
4
votes
1answer
446 views

Authorization and Authentication using multiple types of authentication in MVC

Currently I am managing a team where we're building a new SaaS application. The way it is currently structured is that we have a solution that has our business logic and data, and a solution that ...
-1
votes
1answer
50 views

Find out the user has access to this area - role [closed]

I am in the process of building such that the user access to the different kinds of areas. I must have sure me that, for example Admin part is for shared Admin. It is for sure me that I can ...
2
votes
1answer
331 views

Proper use of model in asp mvc

What is a proper use of model in asp mvc? Should a model contain only data that will be accessed inside a form, or it is also a good idea to put data that are static and would be used in a view, but ...
-1
votes
2answers
75 views

Permuting and combining the values based on the key

I am trying to generate a table which would show all possible combinations based on the key. To make it more clear lets say I have a kind of Key, Value pair set(Its mentioned kind of because there are ...
2
votes
1answer
149 views

Business logic in the models?

I use the repository pattern for data handling. In my DAL folder i have IUserRepository, UserRepository and UserContext. Inside the models folder i have a class called User like id, username etc. I ...
-2
votes
1answer
60 views

Best way to control serialisation of posted form data [closed]

I'm working on an ASP.NET MVC project. I have a form that is strongly typed. Is it considered good practice to add serialisation attributes to the same view model to control how the data is serialized ...
2
votes
5answers
601 views

Architect in our company is against DTO [closed]

I have this easy DTO (Data Transfer Object): public class SoonestOffersModel { public Offer Offer { get; set; } public DateTime Date { get; set; } } Offer is entity. Our architect is ...
-1
votes
1answer
36 views

Handle Field Level Access on MVC Form [closed]

I came across and programming issue in my MVC app where I need to provide field-level security for some of my forms. So I need to display or hide fields on the form, based on the user's permissions. ...
2
votes
1answer
135 views

Who does what in a Single Page Application? [closed]

My development background is in ASP .NET webforms. I've been reading various SPA tutorials but they always get into the weeds about specific javascript libraries. I'm just trying to understand what ...
4
votes
1answer
2k views

Separating ASP.NET IdentityUser from my other entities

I have a ProjectName.Core library containing all my business logic and my entities and their behaviour. There's currently no relation whatsoever to Entity Framework or any other DAL because I like to ...
1
vote
0answers
50 views

Strategies for creating a mobile site? [closed]

I'm looking for 2nd & 3rd opinions on a general mobile strategy for a website I work with. We have decided that tablets generally have an acceptable experience with our site (especially in ...
1
vote
3answers
174 views

CRUD operations in DDD

I'm designing an application with DDD. I'm moving from flat POCO objects to strong domain models, so my question is: Would I have to call my basic CRUD operations (located in my repository layer) ...
13
votes
4answers
6k 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 ...
57
votes
6answers
126k views

What's the difference between stateful and stateless?

The books and documentation on the MVC just heap on using the Stateful and Stateless terms. To be honest, i am just unable to grab the idea of it, what the books are talking about. They don't give an ...
0
votes
1answer
39 views

Is the controller in Angular and ASP.NET MVC aimed to the same?

Is the controller in Angular and ASP.NET MVC aimed to do the same like: Consume services to shape the data (model) to return to the view. Modal validation.
3
votes
1answer
512 views

Separation of concerns between repository and service in DDD with complex entities

This probably seems as an example of opinion-based question, but I'm actually looking for rationale on how to decide correctly, I believe there is a correct solution that can be backed by solid ...
5
votes
3answers
189 views

Entity Framework in n-tier application confusion

I'm building a rather large (web) application where I'm using Entity Framework to communicate with the database. My solution is set up in layers like so: Client Website (MVC web application) ...
16
votes
4answers
12k views

Why is there no WSDL type support for Web Api?

So I am just getting started with .Net WebApi and one thing that I am noticing straight away is that there is no Contract defining how the Api looks and should be consumed (Request/Responses from each ...
3
votes
1answer
147 views

Does Having DI Happen in the Composition Root go against the whole point of Dependency Injection?

I am using Dependency Injection for a .NET MVC web application in which I have three basic layers: 1) Web App 2) Service Layer 3) Data Layer I inject the data layer into the service layer and the ...
0
votes
1answer
188 views

MVC Best practice mixing Partial View and JavaScript

I searched the internet and really can't find a good answer to this question. Imagine there is a View that contains a simple tab-element. Each tab-content is loaded dynamically (via ajax) when the ...
27
votes
2answers
29k views

Best Practices for MVC Architecture [closed]

My question is more about how to architect an MVC application. For example, we are encouraged to use DI with the Repository pattern to decouple data access from the controller, however very little is ...
0
votes
0answers
50 views

One form with multiple fields vs several forms doing ajax requests

I have a group of invoices to send to a back end. The requirement is to be able to send everything with a button, so I can do the following: Send everything as form fields name like ...
2
votes
3answers
431 views

Multi user website for MVC project: one, or multiple solutions?

We're starting a new MVC 5 project that will ultimately consist of 4 websites depending on the kind of user: One internal, for company employees. One for agents, independent contractors that work ...
2
votes
3answers
534 views

Difference between 3-Tier architecture and MVC (Model, View Controller) in ASP.Net

I would love to know how the 3-Tier architecture differs from MVC (Model, View Controller) in ASP.Net as it seems to me that the same architecture applies. In 3-tier we have User Services Layer, ...
8
votes
1answer
4k views

Is FormsAuthentication obsolete? [closed]

I am creating a website using ASP.NET MVC 5. I want to know if it is still OK to authenticate user using FormsAuthentication? Did Microsoft release any technology to replace FormsAuthentication?
4
votes
1answer
348 views

Identity Design ASP.NET

I am trying to design a system with the below features, and am currently trying to figure out best way to handle Identity : There will be multiple decoupled parts of the system, with same customers ...
0
votes
1answer
104 views

ASP.NET synchronous commands handlers

A question about DDD, for validating a Proof Of Concept. Let's say we have a webpage that triggers a Domain Event. For instance, updating the status of a client after an interaction occurred on that ...
1
vote
1answer
821 views

Rendering partial View in MVC

i am not so familiar working with partial Views. The reason behind that is that I really do not have the basics of Jquery/JS/Ajax. But I recently found through some SO post that a partial view can be ...
0
votes
1answer
224 views

Asp.net MVC web application and iOS mobile app

I am currently writing a web application in ASP.NET MVC, so far it is mostly a simple CRUD web app. The database is hosted on the cloud and I am using Entity Framework to interact with it. I know ...
2
votes
1answer
139 views

ASP.NET how to handle external application settings

I'm converting an application from C# WebForms to MVC. The application gets settings from a centralized location using Web Services. These are settings you would typically find in a Web.Config, but ...
6
votes
1answer
261 views

Never using Models, only ViewModels

I'm starting a new MVC 5 project from scratch. I'm using EF 6 (Database First) and Identity 2.0. My solution consists of 3 different projects: Data (where I have a .edmx and my DB context), Resources ...