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

Questions tagged [asp.net-mvc]

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

-1
votes
1answer
62 views

Is it good idea to set custom-defined getter and setter in c#?

I tried this way to define custom defined property but I wonder how to handle if any of the dependent properties have null value. public class ObtainedMarksDetail { private decimal? ...
-1
votes
2answers
74 views

Should integration tests use database? [on hold]

I know that integration tests test parts of project that interaction with each other somehow. And I need to test this interaction. And there is the question: 1)Should these tests use real database ...
0
votes
0answers
16 views

Is it good idea to build multitenant saas using Webpi2 OData V3, SPA?

I wanna clarify these two questions 1. is it best combination of tools WebApi 2 OData V3 for presentation layer and SPA for front-end (Angular js, Service Worker, MVC) and horizontal scaling of ...
1
vote
1answer
138 views

Is this a valid site architecture?

We have a legacy site that was written a while back using MVC. It's a valid MVC for the most part except for the Data Access Layer. The site has Models, Views, and Controllers. However, instead of ...
2
votes
2answers
95 views

Do “Unused” Variables In A View Model Get Passed To The Client In MVC?

Let's say i've got the following absurd viewmodel in a MVC application. public class Absurd { public string WelcomeMessage {get; set;} public string PlainTextAdminPassword {get; set;} } And this ...
3
votes
0answers
48 views

Using Active Directory ObjectSid as Primary Key in SQL Server for Data Access via ASP.NET MVC

I am designing an Intranet employee reward web app using ASP.NET MVC C#/MS SQL Server. This will only be accessed from within the network. Employees and managers will be able to give a reward to ...
1
vote
1answer
71 views

Onion Architecture, Project Architecting and Authentication

I am learning ASP.NET MVC & Web API and trying to implement Onion Architecture with Repository Pattern for one of my Test projects as part of my learning. I have developed single MVC Projects ...
-1
votes
2answers
125 views

Argument for staying on Rails instead of migrating to .net MVC?

I work for a Rails SaaS platform that was recently acquired by a primarily Microsoft shop. They are pushing the issue we need to rewrite the entire application in .NET. It's very clear they know ...
2
votes
2answers
143 views

Is it better to have a single query that returns all related entities, or separate queries for each case?

Summary When writing methods to query for related entities, is it better to have a single method for all related entities or separate methods for each combination? Full Problem I'm writing ...
0
votes
2answers
243 views

Unit Test a CRUD Controller MVC

I have looked through answers related to this but they don't seem to solve my problem. I am fairly new unit testing and testing as a whole. I just finished a small web application using ASP.NET Core ...
2
votes
0answers
50 views

Displaying entity framework calls in Sequence Diagram

I have a controller action which gets all the Plants by location from the database puts it inside a view model and passes it to the view. public ActionResult index() { List<Plant> plants = ...
0
votes
0answers
25 views

Implementing the Repository-Client and Interface Pattern with a common controller assembly

I'm currently working on an MVC project for a web utility. This utility takes input from a user, sends it off via JSON to an API that reads from a database, and brings the data back in tables; it does ...
3
votes
1answer
80 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
150 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
597 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
153 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
279 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
391 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)) ...
3
votes
1answer
660 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
559 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
73 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
32 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
658 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
44 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
235 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
160 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
186 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
248 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
132 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
43 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
329 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
182 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
1k 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
210 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
617 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
127 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
325 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
108 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
151 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
127 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
258 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
116 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 ...
1
vote
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
98 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
161 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
792 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
290 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
569 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
320 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 ...