Questions tagged [asp.net-mvc]
The ASP.NET MVC Framework is a Microsoft web application framework that implements the model-view-controller (MVC) pattern.
559 questions
3
votes
1
answer
168
views
How do async action methods maintain their network connnection?
In ASP.Net MVC, the classic (synchronous) way to write an action method is to return ActionResult. More recently, the ability to perform action methods asynchronously was added, by allowing action ...
9
votes
3
answers
4k
views
Are Repositories needed any longer in ASP.net 5 & EF7?
I posted a question on github to the EF Team. I got a reply saying it would be better to ask this question here so I will copy and paste it here as we as a link so other can see the few replies on ...
7
votes
1
answer
4k
views
Why use Razor Syntax?
Was doing some reading today about Razor Syntax with MVC Framework and was wondering why would/should I use Razor? What benefit does it provide over doing the same thing in the code behind and/or ...
1
vote
1
answer
1k
views
Project structure for Web, Api, DAL and ViewModels
I have a ASP .NET WebApi and a Web Project. I'm about to create a DAL class library... Which will be my codefirst/POCO's or possibly edmx files.
I'm wondering do I need to have another class library ...
8
votes
7
answers
3k
views
A property that can represent both a single date and a date range: How to properly model that?
I work in a system that can represent a "shipping estimate" in two ways:
A specific date: The item is guaranteed to ship at that date
A day interval: The item will be shipped "X to Y" days from today
...
-1
votes
1
answer
816
views
Winform User Control on ASP?
I wrote a C# Winform User Control as follows when Executable is Run:
My question is how we can use this Winform C# user control in one ASP Page. I know about WEB User Control and using in ASP but what ...
7
votes
4
answers
3k
views
Where to put User Interface/Domain Model manipulation logic (transferring data from the view to Domain Model)
We are starting on a greenfield project in ASP.NET MVC. I've used the MVC pattern in other stacks (PHP and Ruby) and I keep running into the same problems of where to place business logic, UI logic, ...
1
vote
1
answer
1k
views
Layer application and token authentication
Suppose we have an application with multiple layers in .Net:
Domain layer (entities)
Data access layer (entity framework)
Business layer
Web Services layer (Web Api)
Presentation layer (MVC)
Now I ...
3
votes
1
answer
1k
views
How to refactor services into API, repository and caching (.NET)?
I am working on a .NET project with, which started out as a prototype that now has to scale. We have the ASP.NET MVC stack with Entity Framework (code first).
I would like to hear how to scale this ...
52
votes
7
answers
23k
views
Why does everyone put controllers in one folder and views in another?
I'm getting ready to take the bend out of asp and into an mvc framework, asp.net mvc or nancy. Wherever I go, I see folders for controllers/modules and folders for views. Is this just a pavlovian ...
2
votes
1
answer
1k
views
Let Xamarin clients listen when server send an API
My situation
I will make a Xamarin application for Android that can access an ASP.NET MVC webserver with API's. The problem is when I'll send an API to the server, all the connected clients must ...
3
votes
0
answers
2k
views
Multiple inheritance in ASP.NET MVC Controller
In one case BaseWizardController should implement background functionality of BaseController->BaseConsumerController, in other case it should implement only BaseController.
Any ideas how can I do ...
0
votes
1
answer
1k
views
Data Structure for Form or Survey [closed]
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 ...
1
vote
0
answers
317
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 ...
2
votes
1
answer
777
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 ...
10
votes
2
answers
2k
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{
[...
7
votes
1
answer
1k
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 ...
9
votes
1
answer
3k
views
Log and trace with Azure Application Insights only (instead of combining NLog and AppInsights) in Asp MVC [closed]
I was going through several blog posts at 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 ...
5
votes
1
answer
814
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 ...
5
votes
1
answer
12k
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
into separate ...
-2
votes
1
answer
674
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
5
answers
3k
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 against ...
-1
votes
1
answer
2k
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. ...
3
votes
1
answer
356
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 ...
3
votes
1
answer
445
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 ...
1
vote
0
answers
69
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
2
answers
212
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 ...
-1
votes
2
answers
2k
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 ...
5
votes
3
answers
5k
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) ...
1
vote
1
answer
954
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.
1
vote
1
answer
1k
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 ...
0
votes
1
answer
3k
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 ...
7
votes
1
answer
3k
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 ...
7
votes
4
answers
2k
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)
Server
...
0
votes
0
answers
411
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 form1_detail_text
...
3
votes
3
answers
5k
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 for ...
10
votes
3
answers
50k
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, ...
2
votes
1
answer
16k
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 ...
-1
votes
1
answer
666
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 ...
8
votes
1
answer
838
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 ...
1
vote
1
answer
1k
views
Code First Approach and Business Classes Validation
I have a solution split into two projects : A class library containing all of my model classes (lets call it Business), and an ASP.Net MVC project.
My Business classes are meant to be generic and ...
1
vote
2
answers
379
views
Performance concern in object oriented languages [duplicate]
I recently moved into web development using ASP.NET MVC. The language I use is C#. Having considerable experience in C makes me look for optimized coding standards (memory, efficient data structures ...
2
votes
1
answer
792
views
Handle files on a remote location
Our intranet application is used to document and store office files. Both app and server are hosted remotely on the same server. Due to fact that our app server is changed every couple of years, we ...
3
votes
3
answers
1k
views
How to see Entity Framework code with ASP.NET MVC from a software architecture viewpoint?
Let's say I'm starting a Web Application project that uses
a) ASP.NET MVC
b) Entity Framework
In terms of Software ARchitecture, correct me if I'm wrong,
-1) Could I place all my Entity Framework ...
0
votes
1
answer
302
views
AngularJS and ASP MVC
We have started to implement AngularJS in our web-applications using ASP MVC.
I am wondering what approach to use for building application in the future.
Keep using our current stategy: Build the ...
0
votes
1
answer
179
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 ...
3
votes
1
answer
512
views
Bower, NPM, Gulp in ASP.NET MVC, what problem am I solving? [closed]
I work at a small web development company, and we use no dependency management whatsoever at the frontend side. External libraries are simply downloaded and pasted into the lib folder of whatever ...
9
votes
3
answers
37k
views
Repository pattern with service layer - too much separation?
I have an MVC site which uses the repository pattern. I don't feel like I'm using the MVC style enough, so I'm getting ready to re-architect some of it. But I'm also wanting to do it so if the front-...
4
votes
2
answers
6k
views
Unit Testing without DI
I am starting a small ASP.NET MVC project, each task on the board must come with unit tests. The project is small, just a few pages with not that much processing, so I decided not to implement DI. My ...
3
votes
0
answers
2k
views
Domain Driven Design - DataServices vs Repositories for Domain Models vs Database Models [closed]
I've been trying to refactor an old design in to an Onion Architecture in DDD style. To that point, the project went from a monolith to 4 sub-projects:
/src
/Project.Application
/Services
...