Blazor in MVC: Component gets rendered, but @onclick not working. Problem with connection
I'm trying to use Blazor in a .net core 3 MVC project. I used a few tutorials to do this, like [https://fizzylogic.nl/2019/08/18/integrating-blazor-in-an-existing-asp-net-core-application/](https://fi...
- Modified
- 3 Dec at 14:40
.NET core 3: Order of serialization for JsonPropertyName (System.Text.Json.Serialization)
While migrating to .NET Core 3 I've switched from Newtonsoft.Json serialization to System.Text.Json.Serialization. Of all the features I want to continue using JsonPropertyName attribute. Newtonsoft...
- Modified
- 2 Sep at 19:18
Unable to track an entity of type because primary key property 'id' is null
After I upgraded to Asp.Net Core 3.0 I am getting the following error for my Identity class when attempting to create a user: > Unable to track an entity 'User' of type because primary key property ...
- Modified
- 2 Dec at 07:33
Does Servicestack.Redis support cluster enabled redis?
Can anybody give the information whether ServiceStack.Redis support cluster enabled redis or not? Thanks in advance
- Modified
- 2 Dec at 05:37
How to avoid "CUDA out of memory" in PyTorch
I think it's a pretty common message for PyTorch users with low GPU memory: ``` RuntimeError: CUDA out of memory. Tried to allocate MiB (GPU ; GiB total capacity; GiB already allocated; MiB free; ...
- Modified
- 28 Mar at 12:27
How to change activity of a discord.py bot?
I want to change the bot status from playing to watching. I've tried this but it's still playing status: ``` import discord from discord.ext.commands import Bot from discord.ext import commands import...
- Modified
- 16 Jun at 01:43
React Typescript - Argument of type is not assignable to parameter of type
I have a demo [here](https://stackblitz.com/edit/react-ts-xoktyd?file=Form.tsx) It's a React app using Typescript and hooks to capture entries into form that are simple displayed below. Here in Stac...
- Modified
- 1 Dec at 13:29
How to Watch Props Change with Vue Composition API / Vue 3?
While [Vue Composition API RFC Reference site](https://vue-composition-api-rfc.netlify.com/api.html#watch) has many advanced use scenarios with the `watch` module, there is no examples on ? Neither is...
- Modified
- 14 Jul at 02:8
Servicestack converting timezone from UTC to any timezone
I have read you don't have support for this. But I want to make sure I am not missing something. We have several cases where we need to convert the saved UTC dates into other timezones. During a quer...
- Modified
- 1 Dec at 02:29
Process terminated. Couldn't find a valid ICU package installed on the system in Asp.Net Core 3 - ubuntu
I am trying to run a Asp.Net Core 3 application in Ubuntu 19.10 thru terminal using `dotnet run` command but it does not seem to work. I get this error. > ``` Process terminated. Couldn't find a valid...
- Modified
- 9 Mar at 14:9
How to get a Shared Access Signature on a Blob using the latest Azure SDK .NET API v12?
I used to be able to create a shared access signature on a Blob using the v11 Azure SDK API, like this: ``` var containerName = "mycontainer"; var blobName = "myblob"; CloudStorageAccount storageAcc...
- Modified
- 15 Nov at 12:10
Nullable reference type in C#8 when using DTO classes with an ORM
I activated this feature in a project having data transfer object (DTO) classes, as given below: ``` public class Connection { public string ServiceUrl { get; set; } public string...
- Modified
- 10 Apr at 21:5
Solutions to communicate with spring boot sseemitter from wpf client
I have one wpf application and a spring boot application, and want to use server sent events to notify the wpf application when something occurs. I googled "c# sse client" or ".net sse client" and so...
- Modified
- 30 Nov at 10:40
System.Text.Json: Deserialize JSON with automatic casting
Using .Net Core 3's new System.Text.Json JsonSerializer, how do you automatically cast types (e.g. int to string and string to int)? For example, this throws an exception because `id` in JSON is numer...
- Modified
- 30 Nov at 17:35
ASP.NET MVC Core API Serialize Enums to String
How to serialize Enum fields to String instead of an Int in ASP.NET MVC Core 3.0? I'm not able to do it the old way. ``` services.AddMvc().AddJsonOptions(opts => { opts.JsonSerializerOptions.Con...
- Modified
- 24 Sep at 12:6
Simulating CancellationToken.IsCancellationRequested when unit testing
I would like to test a task that is supposed to run continuously until killed. Suppose the following method is being tested: ``` public class Worker { public async Task Run(CancellationToken cancel...
- Modified
- 28 Nov at 12:15
JsonOutputFormatter in ASP.NET Core 3.0
In asp.net core 2.2 I used to have the following, ``` var jsonSettings = new JsonSerializerSettings { ContractResolver = new SubstituteNullWithEmptyStringContractResolver() }; services.AddMv...
- Modified
- 28 Nov at 05:36
Call method x times using linq
I would like to call one method 3 times Using **LINQ**, the method returns an object, with that object I want to add it into a List, How do i do it? ```csharp List lstNews = new List(); lstNews.Add(Co...
How to catch all variants of a generic exception in C#
I would like to catch all variants of a generic exception class and I was wondering if there is a way to do it without multiple catch blocks. For example say I have an exception class: ``` public cla...
ServiceStack - How to Deserialize DateTime which could be in multiple formats per each request without overriding global defaults
I have some global defaults ``` JsConfig.DateHandler = DateHandler.ISO8601; JsConfig.AlwaysUseUtc = true; JsConfig.AssumeUtc = true; ``` I am reading CsvFiles which have date fields that are in mul...
- Modified
- 28 Nov at 10:29
How do you mock an IAsyncEnumerable?
I want to unit test a method that calls another method of a service returning an `IAsyncEnumerable<T>`. I have created a a mock of my service `Mock<MyService>` and I want to setUp this mock but I don'...
- Modified
- 3 Mar at 14:32
What is the correct way to use linq type methods with IAsyncEnumerable?
There does not seem to be any included linq support for IAsyncEnumerable packaged with .NET Core. What is the correct way to be able to do simple things such as ToList and Count?
- Modified
- 27 Nov at 05:47
System.Text.Json: How do I specify a custom name for an enum value?
Using the serializer capabilities in .NET Core, how can I specify a custom value for an enum value, similar to `JsonPropertyName`? For example: ``` public enum Example { Trick, Treat, [JsonP...
- Modified
- 26 Nov at 22:0
Should this unsafe code work also in .NET Core 3?
I'm refactoring my libraries to use `Span<T>` for avoiding heap allocations if possible but as I target also older frameworks I'm implementing some general fallback solutions as well. But now I found ...
- Modified
- 26 Nov at 13:48
C# Fire and Forget Task and discard
I need to do a fire and forget call to some async method. I realised VS is suggesting that I can set the call to a _discard and the IDE warning goes away. But I'm not sure if that call is still not aw...
- Modified
- 26 Nov at 09:52