6 questions
-3
votes
1
answer
80
views
.Net Core 9 DI for dynamic instance creation and its required services [closed]
I have the following 2 classes. MyClass composes MyOtherClasses. Each of them requires different ILogger<foo>:
public class MyClass
{
private readonly ILogger<MyClass> _logger;
...
1
vote
2
answers
137
views
System.CommandLine root command option handler fallback
I want to add a Option<bool> to the root command but still show the default output when the option is not provided.
RootCommand rootCommand = new RootCommand("My root command");
...
-1
votes
1
answer
45
views
Adding an IQueryable<> value to an existing query kills performance with Entity Framework Core and PostgreSQL
I have table A with millions of rows, and there's a one to many relationship to table B, where each entry for the item in A will only have 1-4 values. When I query, as part of my returned data, I need ...
4
votes
1
answer
126
views
Optimized Conversion from TSource to TDestination Using INumber<T> in .NET 9
I am working on a method to convert a numeric value of type TSource to another numeric type TDestination in a safe and optimized way. I am using .NET 9 and the generic INumber and IMinMaxValue ...
1
vote
1
answer
69
views
EF Core finding attribute via convention that I don't want it to
I have a class library representing my EF Core 9 database. That library includes a NuGet package of attributes that are set on the model. It's used to configure the generation of PUML files at ...
4
votes
1
answer
970
views
For which specific use-case is the new `System.Threading.Lock` in .Net 9 introduced?
I'm trying to wrap my head around the new System.Threading.Lock object in c#9.
In the old days I used to use good old lock(object) to prevent multiple threads accessing the same part of code like so:
...