Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

2
votes
1answer
37 views

In an asp.net mvc application, can I use Entity layer as Model?

I am developing an asp.net mvc solution, which contains the three layers: Data Access Layer Business Layer Entity Layer Each layer is a project. I have developed the controllers and views, but no ...
1
vote
1answer
132 views

Should I use Adaptor, Facade, Abstract Factory or Factory pattern to refactor God controllers

Our system was initially created around the client's ordering logic which is received by an API. This was allowed by the previous I.T. dept. However over time (after growth) many different clients ...
2
votes
2answers
123 views

How do I avoid increased memory consumption by browser and performance degradation when dealing with many records?

In my MVC 5 web application there are many instances in which users will require to view thousands of records within grids, now I managed to get around many performance related issues by utilising the ...
5
votes
2answers
137 views

Is it worth implementing Entity Framework when calling a single stored select?

I'm currently building a web application for my enterprise level business internship. This web application will track data from three different sources: a DB2 database, a SQL Dynamic database, and an ...
1
vote
3answers
184 views

How to handle fails caused by business rules and return reason to end user?

Let's say I have a asp.net-mvc application and I have to check that object can be deleted before deleting it. public class ItemController : Controller { public ActionResult DeleteItem(int itemId) ...
0
votes
1answer
122 views

Catching exceptions in service layer without hiding bugs

Let's imagine we have a service CustomerService: public class CustomerService { public Customer GetCustomer(string customerName) { if(string.IsNullOrWhiteSpace(customerName)) ...
1
vote
1answer
264 views

asp.net web api and mvc architecture for web application

We have a single solution visual studio web application with multiple projects. One of the projects (Services project) has APIs for our App clients (Android/Ios). There's separate project for MVC ...
0
votes
2answers
194 views

How can I redirect to an ASP.NET MVC page with extended session?

Scenario We have an application which has a session timeout of 20 minutes. However we have a requirement in which users must be able to access a certain page in the site for 8 hours after the ...
0
votes
1answer
43 views

MVC Core Data Access Naming Convention Folder vs Repository

We have Customer transaction table with many foreign key relationships. We only want to see certain columns of the 3 tables joined in a web interface. Eg just Date, PurchaseAmount, ProductName, ...
0
votes
0answers
28 views

Keeping templates on server - Angular 2+ SPA with ASP.Net WebAPI

We are planning to build a SPA in Angular 2+, which will use ASP.NET as a back-end. Since Angular doesn't really have a good integration to ASP.NET, we decided to create the SPA as a standalone ...
4
votes
1answer
239 views

MVC Core Repository Pattern for Multiple Lookup tables

We have Customer transactional table with multiple lookup tables with foreign keys. We want to create dropdown menus using these lookup tables, when CustomerService creates a Customer order ...
2
votes
1answer
40 views

Should the ORM create the related objects (ForeignKey objects) when saving the entity?

This question is coming from a frustration when using the Entity Framework and ASP.NET MVC, but I assume it's a general frustration across more frameworks and languages. Lets say we have an object ...
0
votes
1answer
140 views

UML class diagram for MVC project that run R project

I'm working on ASP.NET MVC project where controller calling static class that run R scripts from external R project Controller public ActionResult Index() { Rscript.Run("...
-2
votes
1answer
80 views

Can I use DI with client of Abstract Factory pattern c#

Let's say I have something like this: switch(i) { case 1: new Class1();break; case 2: new Class2();break; } So what's the best practices of doing this if in class where I placed ...
0
votes
1answer
123 views

asp.net Core 2 MVC - best way to send 1000s of emails every day

We need to send 1000s (under 10,000) per day for a few years. The data is in a SQL Server database - we have many asp.net MVC 5 and .net CORE 2 MVC sites on a Windows 2012 R2 server on IIS. The ...
3
votes
1answer
154 views

Views are not classes how to put them in class diagram in MVC design pattern?

In UML class diagram in MVC software design pattern there are model view controller classes and in ASP.NET MVC all views are cshtml not classes my question is how to put views in class diagram ?
1
vote
3answers
109 views

Is it bad practice to build a large web component as a Html Helper?

So, from my understanding, Html Helpers are supposed to be for single elements or small snippets of html. However, I'm not really sure why I think this, or how I came to abide by the practice. I ...
0
votes
1answer
30 views

Is creating near duplicate partial views solely for populating html elements with Ajax returns violating DRY?

Maybe anti-pattern is a better word for this question. I do not know, but I mean a violation of DRY. Id like to reuse a partial view, and I can, but that partial view has other things in it I don't ...
6
votes
4answers
309 views

How to incorporate external entity models in conceptual model?

If I want to create a conceptual model for my new application, and during the analysis, I found that some objects like employee, department ..etc are a part of another system. and all the data related ...
0
votes
2answers
146 views

Abuse of 302 Temporary Redirect

So I am junior programmer, and I just started working with .net webforms a little over six months ago. I have been studying SEO, and trying to optimize best practices with a senior level developer. I ...
1
vote
2answers
568 views

Is copying a C# class library from one solution to another the only way to “share” that library?

A useful principle in computer programming is DRY (Don’t Repeat Yourself). I am trying to follow this rule as I am refactoring a large .NET Framework MVC project by breaking it down into separate ...
2
votes
2answers
165 views

Disadvantageous of using entity framework layer directly into presentation layer (ASP.NET MVC) by skipping Service layer

In my company, We are planning to build more than one web application on a single Database. The proposed design of each of these apps are - ASP.NET MVC as Presentation layer, Restful API as service ...
2
votes
0answers
537 views

Dependency Injection: Creating object factories vs. using inversion of control containers [closed]

When requiring to use dependency injection, I always use IoC containers such as Ninject, Unity, or the built-in one in ASP.Net Core MVC. However, I've just come across the idea of "why not creating an ...
0
votes
0answers
115 views

Integration Testing a dynamic backend

Our company creates financial software that integrates into a banking system backend. We're running into a lot of problems making changes to it without seemingly impacting another customer or another ...
0
votes
1answer
45 views

What criterias should I use to determine if a new feature of my app should be a new area or a new app? [closed]

I'm building a ASP.NET MVC Core App. I would like to add 2 new features: A new area for Admins and An Web-API for restful services. I was wondering if the Web-API and the Admin area should be new "...
3
votes
2answers
257 views

How is layer between MVC controller and back-end called?

I have ASP.NET MVC application with the following controller and action: public class AccountsController { public ActionResult Index() { var accounts = AccountsManager.GetAccounts(); ...
0
votes
1answer
94 views

Decoupling MVC core project from application specific code? (.NET)

I am wondering if this is a good idea in the first place. Basically I want to create a template upon which to build numerous sites. The idea is I can update the "core" of the website without having ...
-1
votes
1answer
131 views

Null Object and Exceptions

Do Special Case or Null Object design patterns still provide value when application behavior, not just object behavior has to change? I was tasked with revisiting an old application and refactoring ...
1
vote
2answers
118 views

Which approach use when admin can act as some user in application?

The application requires that admin user can provide same actions like real user. It is normal situation when in application changes IIdentity so that when we click to button "Login like some user" ...
0
votes
2answers
156 views

How to generate support tickets through email?

I'm working on a IT service desk system and I'm trying to figure out how to raise tickets via an email or add comments to existing tickets via email replies. For example something like the JIRA ...
2
votes
0answers
111 views

A / B testing without seperate deployments

I am part of a development team producing a project which requires many rounds of iterative development, each of which must be user tested, frequently in an A/B kind of environment. In our deployment ...
0
votes
2answers
2k views

Command/query instead of repository

I'm thinking about implementation of command/query pattern and I have following solution: Interface for queries: public interface IQuery<TResult, TArg> where TResult: class where ...
0
votes
1answer
95 views

Should Active Directory access respect my software architecture?

I have a solution with an onion architecture using an asp.net MVC project. I also access Active Directory, and was wondering if one needs to loosely couple Active Directory access? Say I have : ...
0
votes
3answers
144 views

Designing a CMS. When to use interfaces properly and dependencies and layering

I am building a CMS and need guidance on how to structure the application. I simply do not understand when I should use interfaces or an abstract class. The system being built is using .Net Core and ...
0
votes
2answers
613 views

Handling of user session expiration in MVC-based web application

We have an MVC 5 based web application. Part of functionality includes displaying hierarchical structure as a tree (I use this JavaScript component: https://www.jstree.com/) Tree is displayed in the ...
0
votes
1answer
214 views

Advice on designing models in ASP.Net MVC and database

I'm designing a MVC app and I'm having a hard time figuring how to build my models. For example, I have in my database, Managers, that have a role, are linked to an institution, a program and courses. ...
-1
votes
2answers
428 views

Design pattern when all data access is through a web service [closed]

So I'm working on a new MVC project and all data access will be through a web service. I want to put the service reference and web service calls in a sort of data layer in a separate class library ...
0
votes
1answer
259 views

Specifying concrete type of ActionResult

There are loads of types implementing ActionResult like ViewResult, PartialViewResult, JsonResult, RedirectResult and so on. I have seen two approaches when creating action methods, either always use ...
2
votes
2answers
2k views

Asp.net mvc web api model validation best practice

I have an annoying code smell in my asp.net core api that I am passing around, and I can't come up with a way to fix. In an MVC controller action, usually there is a very straight forward logic, at ...
3
votes
3answers
417 views

What models do I have? And what's a layer?

I've gone through a few tutorials in ASP.NET Core MVC, and I've built a little app (for looking at problems in old exams) that looks roughly like this: Solution Project ... Models ...
0
votes
0answers
615 views

What is best practice for handling a DbContext in an ASP.MVC app?

I am in the currently process of writing an ASP.NET MVC app with Entity Framework which ultimately will be a web browser game with a Microsoft SQL Server backend to handle storing of games being ...
1
vote
1answer
804 views

Where to put methods in a .NET Core MVC Web app?

So I've gone through a few tutorials on writing .NET Core MVC Web apps. I think I've understood the flow from routing a request to the controller (with the EF-dbcontext injected into it) manipulating ...
4
votes
3answers
3k views

Is it a good practice to have one bundle per view in Asp Net MVC

Since bundling and minification is all about optimization and making pages load faster, it appears to me that it would be logical to create one bundle for scripts and one bundle for styles per view ...
1
vote
3answers
1k views

Not wrapping an IDisposable object in a using statement

I am updating some code to allow us to implement unit tests. What I have so far is a Business Layer which calls the repository to get data from the database. Business Layer example: public class ...
0
votes
2answers
654 views

Can not understand how dependency injection can ease testing inside asp.net MVC

Each time i read an article or a book about asp.net MVC , there will be a chapter for dependency injection and repository . now i can easily feel the benefits of using repository over hard coding the ...
1
vote
3answers
1k views

ASP.net MVC static class and background worker

I have an MVC 5 ASP.net app that is working perfectly. A colleague of mine has made a project that reads in data from files and churns some of it to output some calculations for me to display in the ...
1
vote
2answers
453 views

Stateful Single Page Application with ASP.NET Core

I'm building a simple shopping cart using Angular and ASP.NET Core with. There is no login require and user can always checkout and make payment as a guest. The front end would be built with Angular, ...
0
votes
1answer
281 views

Asp.Net Architecture of a thread pool for several users

I'm currently building an Asp.Net website that will allow to import data in several formats into a database. The import status of the the single import jobs are visible to all users and given that a ...
0
votes
0answers
421 views

changing URL of the page on tab click

The scenery is like this, I have a simple ASP.NET MVC website, which has different tabs on one page. Basically, on tab change, I download required content using AJAX, and I get the required content. ...
0
votes
1answer
310 views

What is the best approach to store and execute script from .NET application

I am making an application that will allow user to store and execute simple scripts using Web GUI. Web GUI is ASP.NET MVC and scripts can be of any kind (Python, Perl, AWK, CMD, PowerShell ect. User ...