Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [asp.net-core]

A free, open source and cross platform web development framework for building .NET web applications.

Filter by
Sorted by
Tagged with
4 votes
2 answers
254 views

Is the entire web request the right scope for a DbContext in EF Core?

The usual advice for using EF Core in a web application is to use a scoped DbContext per HTTP request. This is even the suggested default for web application in the Microsoft documentation. I recently ...
Mad Scientist's user avatar
-1 votes
3 answers
135 views

Possible Solutions for avoiding applications sharing database

Background: I work on a small group (5-10) of lightly used .Net web applications. The applications typically have dedicated databases, but there are instances of an application accessing another ...
jessiebot's user avatar
0 votes
1 answer
87 views

Where to put the reference to Application Insights in an application designed with the Clean Architecture template?

We are implementing an application by trying to follow the Clean Architecture template for C#. Our application is an ASP.NET core web api and we want to implement the observability for that ...
Enrico Massone's user avatar
0 votes
1 answer
73 views

DAL class structure for storing and organizing SQL using Dapper?

I'm creating a web application with Asp.Net Core MVC, and I've replaced Entity Framework with a custom data store. I've decided to use Dapper, but have never used it prior to this project. So I'm ...
eaglei22's user avatar
  • 147
0 votes
0 answers
45 views

Avoiding conflicts with Microsoft Two-factor authentication across multiple web applications help

I'm designing a web application and using Microsoft's out of the box Identity and its default Two-Factor Authentication (with Asp.net core MVC and .NET 8). While setting up and testing the 2FA ...
eaglei22's user avatar
  • 147
0 votes
0 answers
52 views

Batch Processing to use multiple pods

We have a frontend application in React and a backend application in .NET Core which were deployed in a single Kubernetes cluster of 3 pods (it can autoscale). Before the application, we have a load ...
Chethan SR's user avatar
2 votes
1 answer
92 views

ASP.NET Core configuration system: Isn't the default configuration prone to naming conflicts in environment variables?

I'm trying to wrap my head around the ASP.NET Core Configuration system. If I understand the default configuration correctly, non-prefixed environment variables will override appsettings.json entries. ...
Heinzi's user avatar
  • 9,768
0 votes
1 answer
102 views

Validation logic dependencies and separation of concerns

I am going back and forth on an aspect of our FluentValidation and MediatR pipeline behavior implementation. We receive requests which, in a Mediator pattern, are mapped to command or query objects, ...
BJ Safdie's user avatar
  • 103
0 votes
2 answers
433 views

What is considered best practice for managing dependency injection for multiple libraries with ASP.NET Core Web API?

Suppose we are building a REST API with ASP.NET Core. Suppose there are 3 projects in our solution: The ASP.NET Core Web API project. A class library project for the businnes layer. A class library ...
user1969903's user avatar
0 votes
1 answer
126 views

What C# Object Composition strategy would you apply for CoreObjects with a governing 'ObjectType' property

In a C# ASP.Net Core Web Application I have a Domain Model CentralDesignObject made up of many component objects & properties, producing a significant amount of derived/calculated values. This ...
freedomdev's user avatar
0 votes
1 answer
88 views

Why aren't mandatory options requested in the signature of ASP.NET Core "AddXXX" methods?

I've developing a .NET Core library meant to simplify the configuration of the authentication within our SSO system. It will expose two methods to be called in the Program.cs (or Startup.cs) of ASP....
Gua-naiko-che's user avatar
0 votes
0 answers
30 views

Per Request Authorization using Facebook Login

Stack: ASP.NET Core + Razor + SQLite TLDR: How do I rely solely on Facebook Login for authorization? I am building an app with sole integration to Facebook for my Facebook group. Essentially it is a &...
Zathura's user avatar
0 votes
1 answer
147 views

Design of system pushing data to multiple systems

I have a ASP.NET Core backend (with Azure Service Bus) and a Blazor Server frontend. The purpose of the backend and the frontend is to trigger manual and automatic pushing of single data points (...
wetfield's user avatar
5 votes
3 answers
2k views

In .net 6 dependency injection and Program.cs, what is the best practice for handling a large number of dependencies?

I've seen a ton of examples of how to do DI, and the example always shows two dependencies. But what about when you have 50 or 100 dependencies (or more) in a large-ish application? The Program.cs ...
NovaDev's user avatar
  • 159
0 votes
1 answer
61 views

sql migration - decoupling deployment from execution

We have a .NET c# solution that uses AliaSQL to run database migrations / to build the backend. I have a situation where we need to write some SQL Server logic that will copy records from Table A to ...
dot's user avatar
  • 571
-2 votes
2 answers
2k views

Chose between .net 4.8.1 and .net core 6.0 . is the support life cycle an important factor to consider

I want to start developing a long-life ERP system to a customer. now on paper I would chose to develop it using .NET core 6.0 with SQL Server. But one of the main drawbacks which the customer did not ...
microsoftdeveloperdesigner's user avatar
-1 votes
1 answer
265 views

PowerApps with SharePoint Versus ASP.NET core with SQL Server

I have around 6 years of experience in SharePoint, ASP.NET MVC, ASP.NET Core MVC & SQL Server. Now when I want to take a decision, if the project should be implemented using SharePoint/PowerApps ...
microsoftdeveloperdesigner's user avatar
0 votes
1 answer
64 views

Including currect user/roles data within object state in .Net applications to control object behavior

I am building a .Net Core Blazor Server application. The application creates records of a Project class which move through a workflow with various phases of review and acceptance/rejection before ...
aterbo's user avatar
  • 111
5 votes
1 answer
3k views

Should web API controller actions that perform no async work always be declared as async?

I have been going over our app web api and making sure all async work is async all the way - and no artificial asynchronicity is enforced. Say I have the following web api controller: [HttpGet] ...
Veverke's user avatar
  • 441
0 votes
4 answers
160 views

Microservice arcitecture - seperation of services

The Microservice arcitecture is still a new thing for me to work with, so it gives me some unanswered questions. In my case each MicroService has its own database. I need a UserService to handle CRUD ...
Martin C's user avatar
2 votes
3 answers
436 views

What should we do in face of a failing sub in pub-sub?

I'm working on a microservices application that is implemented from the ground up with MediatR em CQRS. We have a list of domain events that will be published via MediatR [simple pub-sub library that ...
underthevoid's user avatar
4 votes
1 answer
1k views

Seeding data into a new microservice

I've been reading though Architecture for containerized .NET applications book, and I have a question about replicating data from from service into another: And finally (and this is where most of ...
Q-bertsuit's user avatar
1 vote
1 answer
282 views

Pulling a service out from a modular monolith

I've been looking into the Modular Monolith, especially how it's described by Kamil Gryzbek. From what I understand, the architecture should easily support pulling a single service out from the ...
Q-bertsuit's user avatar
0 votes
1 answer
104 views

Benefit of using Dependency Injection inside ASP.NET Core MVC

I am reading this article about using DI inside ASP.NET Core @ https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-6.0 .. but i can not understand its ...
test test's user avatar
2 votes
3 answers
1k views

Is It Considered Good Practice to Use Dependency Injection with Strategies from a NuGet Package?

I am developing a NuGet package which contains shared code for various ASP.NET Core projects. I am planning to use the strategy pattern to solve the same problem in a few different ways. So there will ...
Treker's user avatar
  • 199
1 vote
3 answers
968 views

Domain Driven Design - Aggregate Root and Nested Aggregate Invariants

I've come to a bit of an impasse with the best way to implement a DDD problem, and am hoping for some advice from those with more experience, please. I have a RecipeCollection, which has a collection ...
danwag's user avatar
  • 119
-1 votes
1 answer
599 views

REST API designing resources for complex entities

I have an ASP.Net Core Web API where I am having difficulties designing the REST resources based on the EF Entities I have. There are three entities that describe a Reservation. First, there is the ...
J.Paravicini's user avatar
1 vote
1 answer
2k views

How to handle duplicate validation logic with CQRS pattern

I am implementing a CQRS pattern in ASP.NET Core with MediatR, and I am wondering what the general consensus is for handling duplicate validation logic for queries/commands which operate on the same ...
Mark Lisoway's user avatar
0 votes
2 answers
337 views

Which strategy to use to create object instances

I have this use case (I've simplified it): Each student can apply for one or multiple activities. As of now we only have Swimming activity onboarded on the system, but we expect to have more. Base ...
Juanma's user avatar
  • 109
0 votes
2 answers
154 views

Is it bad style to share a Model class between two API Endpoints?

I have the following scenario: My .NET Core API has two Endpoints CreateProduct and UpdateProduct. The only difference between the two will be that UpdateProduct will need to know the ID of the ...
Dario's user avatar
  • 1,055
1 vote
1 answer
473 views

Testing API with Auth0-enabled user authentication and authorization

I have a REST API and a SPA application, with Auth0 server issuing access tokens and enabling end users to login with their social identity provider. The API expects to receive a JWT access token with ...
0lt's user avatar
  • 113
1 vote
0 answers
194 views

ASP .NET Core 6 - .razor components - Routing

I come from a background in ASP.NET MVC 5 on .NET 4.8. I've been trying to wrap my head around the new razor pages, and can't seem to get routing to work, or understand it, even. I don't want to use ...
Allen Clark Copeland Jr's user avatar
2 votes
1 answer
736 views

In an MVC Application, What Goes Where?

In an Model-View-Controller (MVC) design pattern, What goes where? What code goes to model and to controller? I know (do I?) that business logic should be define in a model, but a lot of example I ...
careLess's user avatar
1 vote
0 answers
256 views

Microservice code reuse strategy for static classes

Hope this is the right place to post an opinion-based question like this. I'm in the process of converting an aging API monolith to a set of .NET 5/C#-based microservices and working on the code reuse ...
JTennessen's user avatar
0 votes
2 answers
464 views

Is it safe to use the same IoC container for your own and third-party services?

I am developing an application with ASP.NET Core with the ability to dynamically add new libraries that implement the necessary functions. They can be included at the start. I have already written ...
Ramir Gimaltdinov's user avatar
5 votes
5 answers
14k views

Is it a bad practice to use Singleton for DI in Asp.net rather than Scoped, Transient whenever possible?

We had a conversation (with coworkers) about why we needed to use Singleton for Controller, Business Services, and Repositories. The reason for this, they claim, is because singleton ensures that code ...
Udemytur's user avatar
2 votes
2 answers
2k views

CQRS MediatR Create many items commad - is it a good practise?

I am here to ask question about: is it good practice to insert many records using CQRS and MediatR? how to structure that in terms of names and folders? A have to insert into database over 500 ...
Grzegorz G.'s user avatar
2 votes
1 answer
2k views

How to unit test public method which internally calls many internal or private methods which are already individually unit tested [duplicate]

In our ASP.NET Core application, we have many APIs which are calling public method from the service class. Service class is implementing an Interface. Each service method (depending upon complexity ...
WAQ's user avatar
  • 123
0 votes
2 answers
933 views

Where to internationalize emails in a DDD application?

I am building an application with ASP.NET Core 5.0 following DDD and the CQRS pattern. I internationalize on the presentational layer but when I send emails I send them in the application layer via an ...
Carlos's user avatar
  • 21
1 vote
2 answers
2k views

One API or Two APIs one for internal use and the other for external use

I follow the Layered architecture Like this: But with two differences: I use Blazor Assembly for UI Layer. I have API layer(REST) In between the presentation layer and the service layer. My ...
Anyname Donotcare's user avatar
0 votes
1 answer
93 views

How best to structure this MVC or Razor Pages web application given a required tcp/ip server data source that acts like a web api?

I am rewriting an old asp.net 4.0 web forms website that exposes an application's data and logic to the web. I am moving this to a .net core mvc or razor page project. The website has minimal ...
Zevias's user avatar
  • 9
0 votes
1 answer
1k views

ASP.NET Core - Using Partial Views inside a Modal window for my Add/Edit/View Details screens?

I've been developing .NET projects for the past 3 years, and on my recent web .NET projects, I've been using Partial Views for all the screens that contain Forms for Add/Update/Delete or other ...
hds's user avatar
  • 1
0 votes
0 answers
874 views

add web api endpoint, which return html from view

I have ASP.NET 5 Web Api and need to do the following task: Add endpoint, which get cshtml page and return generated html, so it should do the same what is does razor view engine. What is better way ...
Alexan's user avatar
  • 249
0 votes
0 answers
30 views

Design a multiple Asp.Net Core apps Solution

I am having an .Net Core Solution consisting of 3 Projects: The Site (Asp.Net Core MVC WebApp) The API (Asp.Net Core API) The "Common" library for shared functionality. The Common library ...
Mats's user avatar
  • 163
0 votes
2 answers
248 views

Extend the ApplicationUser class or use a Person class?

I am making a web system using Asp.Net Core with individual user accounts (Identity), and I was thinking about how I should store the users' personal information in the database. The system will have ...
Stian's user avatar
  • 131
0 votes
1 answer
913 views

Replacing in-memory queue with messaging queue service

In our application (ASP.NET core) we have events that require computations and which results need to be persisted in a database (the objects are projects that need recalculations when a property ...
Superman.Lopez's user avatar
1 vote
1 answer
4k views

why controller lifetime is transient by default in asp.net core? [closed]

I know the lifetime of the controller class is transient by default, but I think it's better to be singleton. should explain to me why creators choose transient instead of singleton or scope lifetime? ...
Mujan's user avatar
  • 141
2 votes
2 answers
1k views

What is suggested way to use iHostedService of .NET core or Windows service when process runs for exponential hour time (up till hours)?

I wanted to create a background job in which I want to use the retry mechanism for that I want to use the Polly. My requirement is like this: the First retry should be done after 2 hours the Second ...
Hardipsinh Jadeja's user avatar
0 votes
1 answer
33 views

Getting sums of multiple leveled relations efficiently

I'm currently building an API and a web app for an internal warehouse system using NET Core. I have the core entity structure, that goes like this: "Material" has many "MaterialSubtypes&...
Valhaal's user avatar
  • 13
0 votes
2 answers
66 views

Strategy for Chrome timing out on a Database cleanup job which takes a long time

I have a notifications app which sends users notifications. It uses a .NET core backend, an angular frontend and Cosmos DB. Within this I have an API endpoint function which is linked to a button used ...
Watchdogs1499's user avatar

1
2 3 4 5