Stack Exchange Network

Stack Exchange network consists of 175 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.

2
votes
0answers
36 views

Clean Architecture - What is the difference between Use Cases and Core Services?

I'm trying to apply Clean Architecture to a simple ASP.NET MVC Core app by following Microsoft's ASP.NET architecture guidelines and their eShopOnWeb sample project. In the standard Clean ...
0
votes
4answers
152 views

How do you manage objects that are shared between back-end services and front-end services/apps?

I have multiple REST-ful APIs that I'm using as my "back-end". I also have multiple web apps (.NET MVC). These web apps make calls to the APIs for data. So, an object being returned by an API will be ...
0
votes
1answer
53 views

MVC Controller calling UoW (unit of work) directly instead of going through Service Layer

Currently im injecting my Unit of Work inside the controller. I figured out that in most of the designs, controllers calls the service layer and service calls the repository/DAL layer. Most of the ...
0
votes
1answer
34 views

Handling Authentication with both Web App and API

Not sure how to handle this. Our current app (.Net MVC) is accessed via companyname.appname.com, authentication is handled via forms (cookie) authentication. Within the app there is a global search ...
1
vote
4answers
390 views

Is dependency injection always a best practice?

Recently I started working on a rather large monolithic system. The solution has web, app and api parts and in general just a lot of stuff. It relies heavily on dependency injection and I noticed ...
0
votes
1answer
84 views

ASP.NET Core - Is using [FromServices] attribute bad practice?

I have a Controller in ASP Core MVC. I'm trying to trim down the dependency injected services in the constructor so I can start building unit tests more easily. However, I have some services being ...
0
votes
0answers
65 views

Asp.Net Boilerplate (ABP) Module system - Why?

My question pertains specifically to the module system implemented in the ABP framework and the associated AspNetZero module, as documented in the official AB documentation. I am trying to understand ...
-1
votes
2answers
85 views

Is there an accepted way to track record metadata, CreatedOn/By etc?

I've worked with a lot of off-the-shelf systems and generally speaking they all, at a database level and above, have metadata such as CreatedBy/On, ModifiedBy/On etc against records/entities to give ...
-1
votes
1answer
24 views

where to put business constraints

We have a 3-tier architecture: Web, Business, Models using the MVC pattern. Models are Code-First using EF6. Currently we access the dbContext directly in our Controllers to query and save changes. We ...
0
votes
0answers
48 views

Authenticated ASP.NET Core MVC site consuming web API

I have an ASP.NET Core 2.2 MVC site, that uses Facebook as an identity provider. Users can click the login button, they are redirected to Facebook to enter their credentials, and are then redirected ...
1
vote
0answers
11 views

Any Performance issue if render partial is used within a parent view

Is there any performance implication if we move the codes of view to a partial view and render the partial view from the parent view like the following: @Html.Raw(ProcessContent(Html.Partial("...
1
vote
2answers
182 views

How can I integrate Python code with c# code? [closed]

I want to integrate code python (hierarchical clustering algorithm) with code C#. (The idea of ​​the project is to divide similar people and put them into classes using the algorithm. We use language ...
0
votes
0answers
48 views

Running multiple MVC projects: One site

I am developing a "platform", I have an MVC site that will hold all the main data, as well as our generic API, uses Microsoft authentication to create an account, then our employee MVC will add the ...
1
vote
1answer
119 views

Correct approach to pass data to service layer

I'm curious what's considered the (best) correct way to pass data to a service layer in ASP.net Core. Say I have a Person entity that has a relation to a Image (profile picture) entity and another ...
-1
votes
1answer
89 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
909 views

Should integration tests use database? [closed]

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 ...
1
vote
1answer
157 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
102 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
1answer
126 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
144 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
199 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
154 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
556 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
145 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 = ...
3
votes
1answer
164 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
173 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
688 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
178 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
503 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
724 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)) ...
2
votes
2answers
980 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
644 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
117 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
38 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
1k 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
50 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
351 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
212 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
302 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 ...
2
votes
1answer
399 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
215 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
59 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
373 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
215 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
267 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
666 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
153 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
46 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
425 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();...