Skip to main content

Questions tagged [.net-core]

.NET Core is a lean, composable and cross-platform framework for building web and cloud applications. It is fully open source and available on GitHub (https://github.com/dotnet/core). Applications in .NET Core can be run and/or hosted on Linux and MacOS under .NET Core.

2 votes
2 answers
1k views

C#: Use Double Await Cause Issues?

We have Application service Method, which extracts data from SQL database using Entity Framework Core . Its Async method along with the Async Controller. Service: public async Task<IEnumerable<...
user avatar
0 votes
3 answers
1k views

When to set constants during DI setup and when expect them on the fly as parameters?

Let's assume you have a project (e.g. .NET Core) using dependency injection. A database repository relies on a database connection string. public abstract class BaseRepository { // use this when ...
Question3r's user avatar
1 vote
4 answers
2k views

Should you validate route parameters or let them fail with a 404?

So this is an example endpoint to fetch one user by its username [HttpGet("{username}")] public async Task<ActionResult<object>> GetUser([FromRoute] string username) { // ... ...
Question3r's user avatar
0 votes
0 answers
512 views

Net Core: Solutions to Update History Tables in Application Design

Our company did not properly design Address Record Code Module. Developers are updating Address SQL table with Multiple Service Methods, and are not updating AddressHistory Sql table. They're asking ...
user avatar
1 vote
1 answer
419 views

keep Controllers at one place or organize by domain

When creating a new .NET Core Web API the controllers will be put in the Controllers directory. I want to create request models for incoming requests (for validation purposes) and response models ...
Question3r's user avatar
2 votes
3 answers
499 views

How to clone an object graph and keep relationships of objects intact?

In my ASP.net core application with Angular 2+ client, I work with a complicated object graph. In the object graph I have some objects with references to each other. I have a simplification included ...
Superman.Lopez's user avatar
0 votes
1 answer
614 views

What's a good liveness probe for a Hangfire background job server?

We're in the process of moving everything to K8s and one of our applications is a small .NET Core 2.2 console app that runs a Hangfire background job server. At the moment the app runs as a Windows ...
Cristi's user avatar
  • 187
3 votes
0 answers
110 views

Technical architecture of platform on .Net Core

I'm designing a platform that will run robots developed by others. Basically anyone could implement a IAutonomousAgent and register the implementation on the platform. At runtime, the platform will ...
Leonardo's user avatar
  • 364
0 votes
2 answers
2k views

Call API endpoint from API itself

I'm creating an .NET Core 3 API with Entity Framework. The data is from an existing database. Now I've the following situation: /persons -- get all the persons /companies -- get all the companies /...
Bjorn's user avatar
  • 67
1 vote
2 answers
780 views

Is there still a place for non-async methods in Data Repository?

If we start a .NET Core 3.0 project today, which will use database connection (for example ASP.NET Core Web API), is there still a place for non-async operations while talking to the database? Or in ...
Adam Wojnar's user avatar
0 votes
0 answers
355 views

Registering dependency implemented in separate assembly with shared interfaces

Situation: I have a project with a Business Layer (WizBang.BL) that contains nearly all of my application logic. It communicates with a Data Layer (WizBang.Data) that contains by entity classes and ...
Valuator's user avatar
  • 101
18 votes
3 answers
33k views

How to justify using await instead of .Result() or .Wait() in .NET Core?

Since the inception of .NET Core, console apps, function apps, ASP.NET etc. are not using synchronization context in async methods (so they're synchronizing straight to Thread Pool). This means that ...
kor_'s user avatar
  • 289
-1 votes
1 answer
227 views

Dependency Injection and Factory resolution

In the below example, assume FooA and FooB each have constructors that have a large amount of dependencies being injected into them. If I have a class that needs to determine which IFoo ...
gilliduck's user avatar
  • 237
1 vote
2 answers
865 views

Unit Testing Complicated Service Call with Many Methods

I am trying to understand principle of Unit testing, Purpose, and Moq. We have complicated Service Call. The Service Call encompasses numerous Repositories and Services, with dependencies and ...
GregDavis's user avatar
0 votes
1 answer
2k views

Should Specification Patterns return IEnumerable, IQueryable, or Expression?

We are implementing Specification Patterns with Domain Driven Design. Company architect also wants us to utilize Generic repository (not my choice). Currently require specification Pattern for Filter ...
Matt Smith's user avatar

15 30 50 per page
1 2
3
4 5
7