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...

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...

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...

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...

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...

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...

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...

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()...

9 Mar at 17:50

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...

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 { ...

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...

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. ...

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 `...

12 Mar at 09:40

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?

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...

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()); ```

10 Mar at 18:32

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...

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...

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...

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...

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...

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...

5 Mar at 05:24

.Net Core 3.1 adding additional config.json file to configuration argument in Startup

I need to add another configuration file to my .Net Core Blazor project. Other sources (such as [this](https://www.c-sharpcorner.com/article/configuration-in-asp-net-core/)) mention using configuratio...

4 Mar at 18:0

SharpApp and Office JS API

I am working with SharpApp. I have created the SharpApp using the Parcel template. Now I am trying to integrate/develop the Excel Web Add-In using Office JS API. But when I run the application I got t...

The LINQ expression could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation EF Core 3.1

I'm struggling with this for four days already and no progress at all. Having a query, which worked just fine before updating to EF Core 3.1: ``` var equipments = await this.DbContext.ServContrObjStr...