Questions tagged [asp.net-mvc]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

TransactionScope in DAO or in BLL (Business Logic Layer)?

I've been working with Entity Framework, Repositories, Unit of Work, DDD, CQRS... But I have an different challenge now...my company is working in the below architecture: Contrllers -> BLL (...
0
votes
1answer
72 views

Right way of folder structure in MVC Project

I'm building a project with C# AspNet.Mvc. I'm using Entity Framework Core. It has Poco which maps in data from DB. On Mvc project itself i've got ViewModels folder where i have models topass between ...
0
votes
1answer
33 views

Checking caller has access to an API resource - Design

We have an api that looks like this https://ourapi.com/api/managers/-/staff, that will get a list of staff that the currently logged in manager has been granted access to. It is the Managers service. ...
2
votes
1answer
68 views

Moving shared CQRS/Mediatr Request Handler logic into services and avoiding code/logic duplicity?

We recently embraced Clean Architecture and CQRS, by way of Mediatr, in several of our new applications. A similar (SPA-based) demo can be seen here. For many of our WebApi-based projects, this worked ...
-1
votes
0answers
40 views

Where's the best place to put formatting logic

I have an MVC application where the data entity structures are in the Model layer. On top of that there is Business layer that sits between the Controllers and Models. There are various places in the ...
1
vote
2answers
118 views

Is this approach with JWT tokens wrong?

I have .NET Core WebApi application with JWT token for authorization. I also have roles and permissions. To make it more flexible for end user, I decided to make permissions like this: [Authorize(...
1
vote
2answers
137 views

How to retrieve a device information (e.g. device name) via web page

What we want to do is very simple We have a check-in kiosk website (C# ASP.NET MVC), and we are trying to set up 30 kiosk stations at each building (each building is about 200 ft away from each other)....
0
votes
0answers
26 views

Integrating Blazor Client side into an ASP.Net MVC Core 3.1 app. Is it logical or am I better off building new Blazor app from scratch?

I am in the middle of a project building an internal admin web site using Asp.Net MVC Core 3.1 Some of the features I need in the app could benefit from Blazor Client side. (Single Page App features?)...
2
votes
2answers
1k views

Is unit of work pattern really needed with repository pattern

I am trying to use EF6 with my project. I just watched Repository Pattern with C# and Entity Framework, Done Right | Mosh video. I understand the necessity of Repositories but I still don't understand ...
0
votes
1answer
339 views

Is it good practice to save an entire ViewModel in Session (C# ASP.NET MVC)

I have an C# MVC Application which is basically a large application form. We are using a large ViewModel to store all the information the user enters as they pass through multiple steps in the ...
-1
votes
3answers
87 views

Using a separate desktop application for handing scheduled tasks in an ASP.NET MVC Application

I have an ASP.NET MVC application and I will need to execute a task every one minute. The task is: -> Go to database -> Check from Table 1 if a record has value = "something" -&...
0
votes
3answers
642 views

ASP.NET MVC - Using Session Variables or Caching to prevent unnecessary calls. Is it a good practice in general?

I have an application that consists of multiple sections of which each section will need to load data from various API calls. Now I'm thinking of taking advantage of Session variables(or caching) to ...
-1
votes
1answer
62 views

How shall I implement a MVC program into presentation, business logic and data access layers?

Here is part of an ASP.NET MVC program, from https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/controller-methods-views?view=aspnetcore-3.1 : A model class Movie: public class ...
0
votes
2answers
58 views

where to put presentation data formatting method

I am trying to display a specially formatted dropdown list as part of a view. I have a controller action which fetches the data for the dropdown, then needs to format it by fetching certain other ...
0
votes
1answer
343 views

Does Asp.Net Identity worth the overhead?

I'm creating web applications using Asp.Net Core Identity with N-Tier architecture. Lately I've been discovering many properties of this library that I didn't know before as I need to configure the ...
0
votes
1answer
119 views

Using WebAPI as infrastructure layer in ASP.NET MVC

I'm starting a new asp.net mvc core project and for my infrastructure layer I'd like to use WebAPI as this layer should be usable in other solutions besides this one. I'm not really experienced with ...
0
votes
0answers
94 views

Is it the right pattern for Razor Pages' private methods to return IActionResult to handler?

Is this a good code pattern in ASP.NET Core Razor Pages, for private methods to return IActionResult to the calling handler? // Public handler public IActionResult OnGet() { var result = ...
1
vote
2answers
79 views

Class property re-use vs redundancy

TL;DR - When designing classes for MVC use, is there "best practice" for how classes should be structured to eliminate property duplication and/or redundancy? I'm trying to avoid large (one-size-fits-...
-2
votes
1answer
310 views

MVC Routing (attribute routing) and project structure

how would i organize my project structure, areas or folders to support logical grouping structure within my project. www.mysite.com/org/{dynamic}/Importer/{controller}/{action} Currently i have two ...
4
votes
2answers
176 views

Multiple Applications, how to bring them together?

I have 7 different .NET Core applications (solutions). All supporting a different workflow such as customer request, request for change and much more. However, they do share a similar goal (that is to ...
1
vote
1answer
75 views

Best practice for multi-application communication and events?

Essentially, I have a web application and a console application. The web application allows users to configure what will be processed, which is just a big information processor. From the web UI, a ...
0
votes
0answers
57 views

DDD with web api, how to correctly display error messages that caused by domain to the client?

I asked a question about duplicate validation in domain or application layer. Now, I decided to put all the business rules in the domain layer. I have a value object like this, it has a method for ...
2
votes
1answer
775 views

DDD with web api, validation in domain or application layer?

I saw a lot of discussion, but I don't know how to do it in a real world. I understand that validation duplication in the client and server is needed. But how to elegantly validate in server and ...
2
votes
2answers
500 views

What do I misunderstand about the mediator pattern?

I decided to use Mediator Pattern (with Mediatr) to call my application layer. It's cool and I got how to work with it sometimes, but sometimes I get confused. For example, when we publish a document ...
1
vote
2answers
208 views

Downloading and appending data from AWS S3 whilst avoiding clashes

I have to upload a TSV file to an S3 bucket, the content is form submission data. Another service will consume and do things with this data as soon as possible. The service would like one large file ...
5
votes
4answers
1k views

Is it valid to let view models populate their own lists for dropdowns in mvc?

I've struggled to find any discussion on this. If you have a simple MVC page for updating a User, and you put a dropdown list on it of Country, you need to populate the dropdown list in the viewmodel....
0
votes
1answer
251 views

Where to store calculated values of an entity

Trying to figure out the best place to store calculated properties related to a base entity class for use through out the application, namely in view models and DTOs. For example, a base entity class ...
0
votes
2answers
180 views

Building Client Specific Application on Top of Standard Application

I have a standard application and in this case, it is an Accounting ASP Net MVC application. Now, I have a new client that has their own specific requirements like other fields and some custom ...
1
vote
1answer
1k views

Simple Audit Logging Design

I have a C# MVC application. One of the requirements of the application is to maintain an audit log of everything that happens to a particular 'entity' page. To make the example concrete, lets say ...
0
votes
1answer
101 views

Authorization & Profiles considerations for ASP.NET MVC Customer Portal

there's an up and running self-serve customer portal built that I'm trying to make a bit better when it comes to displaying proper items for different client types and auto-logging users. Here are a ...
1
vote
1answer
69 views

Should all my asp.net MVC controllers use Web APIs?

The thing that I don't understand is the prioritization between MVC Controllers and Web APIs. Consider I want to make a website. I can either program to APIs and for the presentational layer, force ...
2
votes
2answers
318 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
1k 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 ...
1
vote
1answer
225 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
287 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
665 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 ...
4
votes
1answer
2k 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 ...
-1
votes
2answers
88 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
33 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
135 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 ...
3
votes
2answers
26k 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
323 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
331 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
117 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? ...
3
votes
2answers
7k 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
194 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
202 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 ...
4
votes
1answer
349 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
396 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
446 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 ...

1
2 3 4 5
11