Avoid CS8618 warning when initializing mutable non nullable property with argument validation
I have a question regarding [nullable reference type system](https://learn.microsoft.com/en-us/dotnet/csharp/tutorials/nullable-reference-types) available since C# 8. Suppose we have a C# domain model...
- Modified
- 27 Sep at 00:35
ServiceStack: Is context based routing specified in the URL possible?
I'm looking to retain a ton of functionality I used to have in my codebase from the service layer that I exposed previously using OData services but through ServiceStack, assuming I implement the serv...
- Modified
- 14 Mar at 18:52
Is there a way to programmatically check pending model changes in Entity Framework Core?
I am currently in the progress of setting up a team environment for ASP.NET Core WebAPI development, using xUnit for unit tests in combination with GitLab CI. For database communication, we use EF Cor...
- Modified
- 7 May at 03:48
Expand environment variables in appSettings.json file
Is there a way "out of the box" to have environment variables in `appsettings.json` values expanded automatically? To take a contrived example: ``` { ... "MyPath1": "C:/MyApp/%ENV%/Myfolder1/MyF...
- Modified
- 16 Mar at 22:13
Understanding the request lifecycle and routing mechanism in service stack
(you might want to skip this bit, it's here just in case you want context) I saw from questions like this [ServiceStack CRUD Service routing Documentation](https://stackoverflow.com/questions/14086...
- Modified
- 13 Mar at 23:50
When to use ValueChanged and ValueExpression in Blazor?
I'm seeing this common pattern in some libraries (MatBlazor, Telerik) of having `ValueChanged` and `ValueExpression` properties and it really confuses me. What is the difference between both? And whe...
- Modified
- 12 Mar at 18:47
How to remove WebDav in Startup.cs ASP.NET Core
I published a .NET Core Web API through FTP. By default, some of the methods weren't working(put and delete), because the server has WebDAV enabled as default. To remove this, after publishing the app...
- Modified
- 6 May at 12:13
System.Text.Json.JsonException: The input does not contain any JSON tokens
I'm just trying to use a Http POST method in a Blazor app through ``` public async Task CreateUnit(UnitEntity unit) { await _http.PostJsonAsync<UnitEntity>("api/units", unit); } ``` _http and myO...
- Modified
- 23 Jun at 15:11
Why the continuations of Task.WhenAll are executed synchronously?
I just made a curious observation regarding the [Task.WhenAll](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.whenall) method, when running on .NET Core 3.0. I passed a simpl...
- Modified
- 11 Mar at 18:43
ASP.NET Core Disable Response Buffering
I'm attempting to stream a large JSON file built on the fly to a client (could be 500 MB+). I'm trying to disable response buffering for a variety of reasons, though mostly for memory efficiency. I've...
- Modified
- 20 Jun at 09:12
Why is compilation OK, when I use Invoke method, and not OK when I return Func<int,int> directly?
I don't understand this case: ``` public delegate int test(int i); public test Success() { Func<int, int> f = x => x; return f.Invoke; // <- code successfully compiled } public test Fail()...
ASP.Net Core Serilog How to read from log file during runtime
I'm working on a ASP.NET Core application. I want to log events to file and be able to read them during application runtime. To do that I'm trying to use [Serilog.Extensions.Logging.File][1] NuGet pac...
- Modified
- 6 May at 20:31
Consume the same message again if processing of the message fails
I am using Confluent.Kafka .NET client version 1.3.0. I am following the [docs](https://docs.confluent.io/current/clients/dotnet.html#store-offsets): ``` var consumerConfig = new ConsumerConfig { ...
- Modified
- 9 Mar at 04:39
What is equivalent in JToken.DeepEquals in System.Text.Json?
I want to migrate my code from Newtonsoft Json.Net to Microsoft standard System.Text.Json. But I could not find an alternative for `JToken.DeepEqual` Basically the code must compare two JSON in unit t...
- Modified
- 29 Mar at 03:3
How to configure a default JsonSerializerOptions (System.Text.Json) to be used by Azure Function v3?
I have a set of Azure Functions v3 running on .net core 3.1. I have a custom configuration of `JsonSerializerOptions` that I want to be used automatically by my functions when de/serializing data. ...
- Modified
- 7 Mar at 16:56
Insert OLE Object into MS Word Document and keep the underlying format WMF intact
I am trying to replicate the following method in C# Word interop (NetOffice) ``` Selection.PasteSpecial Link:=True, DataType:=wdPasteMetafilePicture, _ Placement:=wdInLine, DisplayAsIcon:=False `...
What's the counterpart to JObject.FromObject in System.Text.Json
With Newtonsoft Json you can convert an object to a `JObject` by calling `JObject.FromObject(object)`. Is there a counterpart in System.Text.Json to get a `JsonDocument` from an object?
- Modified
- 6 Mar at 13:57
An error occurred while accessing the Microsoft.Extensions.Hosting services when do first migrations
I don't understand what wrong. I tried to make a simple crud in .net core mvc with a very simple model which has few fields. These are my models: ``` public class Employee { [Key] public i...
- Modified
- 18 Feb at 22:47
Best Practice with C#. Is it okay to pass parameters with await?
Is it okay to pass parameters, with `await`? what are the PROS and CONS of doing this? ``` var results = MapResults(await GetDataAsync()); ```
How to acess the appsettings in blazor webassembly
I currentying trying to save the api url in an appsettings. However, the configuration.Propertiers seems to be empty. I am not sure how to get the setting. in program.cs: ``` public static async Task...
- Modified
- 5 Mar at 19:50
How do I use parameters with OrmLiteReadConnectionExtensions.Select(...) passing in a parameterized SQL statement?
I have a project that's using ServiceStack & ORMLite. I need to make use of the `OrmLiteReadConnectionExtensions` extension method `List<T> Select<T>(this IDbConnection dbConn, string sqlFilter, para...
- Modified
- 5 Mar at 19:39
Convert DateTime? to string
I want to convert a `DateTime?` to string. If a date is null then return `""`, else return a string format like this: `"2020-03-05T07:52:59.665Z"`. The code is something like this but it won't work. I...
- Modified
- 5 Mar at 08:5
Android build error "failed to create JavaTypeInfo for class" :Xamarin
Following this tutorial [https://github.com/Vidyo/vidyo.io-connector-xamarin](https://github.com/Vidyo/vidyo.io-connector-xamarin) I downloaded the app without making any changes. When I build the ap...
- Modified
- 5 Mar at 06:49
How to wait for MSSQL in Docker Compose?
I have a (an ASP.NET Core Web application) that depends on MSSQL. The services are orchestrated using Docker compose, and I want docker compose to first start the database and wait for it to be befo...
- Modified
- 5 Mar at 06:8
OrmLite join table by multiple columns
With OrmLite how can I join a table by multiple columns? I have `Notes` table that can have data for either `QutoeHeader` or `OrderHeader` so I tried to join and use `SelectMulti()` like this: ``` v...
- Modified
- 5 Mar at 05:24