Self-referenced generic parameter
For example I have the following classes: 1. ``` class MyClass1 { public MyClass1 Method() { ... return new MyClass1(); } } class MyClass2 { public MyClass2 Method()...
Formatting rule to have blank line between class member declarations
Micrsoft provides bunch of coding settings for EditorConfig [.NET coding convention settings for EditorConfig](https://learn.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-refe...
- Modified
- 19 Feb at 05:45
What does null! statement mean?
I've recently seen the following code: ``` public class Person { //line 1 public string FirstName { get; } //line 2 public string LastName { get; } = null!; //assign null is poss...
- Modified
- 8 Apr at 09:31
Is possible to deploy a self contained .NET Framework application?
I'm developing a C#.Net application that uses the .Net Framework but I'm having trouble when users are installing the application on their computers. Some of them just don't know how to install the .N...
- Modified
- 6 Aug at 15:45
Serilog not writing to File (.net core 2.2)
I am writing a web service that is using Serilog. I was having problems getting files to write out (but console logging worked). I noticed that the setup changed when .net core 2.0 came out based on [...
ServiceStack OrmLite-Mysql Compability (5.4.0) (.net c#)
We have a solution consisting of both .net Framework (4.7.2) and .net Standard (2.0) projects. According to this page: [http://docs.servicestack.net/templates-corefx#reference-core-packages](http://do...
- Modified
- 15 Feb at 12:7
CSV to object list
I am currently using ServiceStack.Text to de-serialize CSV to list of objects. My Model ``` public class UploadDocument { [DataMember(Name = "Patient")] public string Patient { get; set; } ...
- Modified
- 15 Feb at 04:20
How can I use C# 8 with Visual Studio 2017?
I'd like to use C# 8.0 (especially ranges and non-nullable reference types) in Visual Studio 2017. Is it possible?
- Modified
- 3 Oct at 14:53
How to create an Expression builder in .NET
I have written some code to allow filtering of products on our website, and I am getting a pretty bad code smell. The user can select 1-* of these filters which means I need to be specific with the `W...
- Modified
- 7 May at 08:21
What does " yarn build " command do? Are " npm build " and "yarn build" similar commands?
What does `yarn build` command do ? Are `yarn build` and `npm build` the same? If not what's the difference?
IRequestHandler return void
Please see the code below: ``` public class CreatePersonHandler : IRequestHandler<CreatePersonCommand,bool> { public async Task<bool> Handle(CreatePersonCommand message, CancellationToken can...
- Modified
- 12 Feb at 11:20
Push method in React Hooks (useState)?
How to push element inside useState array React hook? Is that as an old method in react state? Or something new? E.g. [setState push example](https://stackoverflow.com/questions/41052598/reactjs-arra...
- Modified
- 25 Feb at 06:24
Is there an explanation for inline operators in "k += c += k += c;"?
What is the explanation for the result from the following operation? ``` k += c += k += c; ``` I was trying to understand the output result from the following code: ``` int k = 10; int c = 30; k +...
- Modified
- 14 Feb at 01:0
Fluent validator to check if entity with ID exists in database
I'm trying to write a custom validator that will check if an entity exists in the database, using OrmLite. The problem is that the type arguments for IRuleBuilder can no longer be inferred from usage....
- Modified
- 13 Feb at 17:17
Customize parameter splitting in ServiceStack Route
I have a REST endpoint that allows clients to get values for one or multiple variables. I'm using ServiceStack to achieve this. The issue arises from how ServiceStack parses multiple variables. It see...
- Modified
- 13 Feb at 14:16
Kestrel unable to start
When specifying a port to bind to with `.UseKestrel()` I get the errors listed below.. but if I remove the kestrel options everything works normally if I check the API from my browser. I've tried bi...
- Modified
- 13 Feb at 13:53
Entity Framework 6, Command Interception & Stored Procedures
I was asked to develop auditing for a system at my work. The system has already been completed. I think EF 6's Command Interception should work well for my purposes. However, there are situations li...
- Modified
- 19 Feb at 19:29
Optional null coalescence in if clause
A colleague of mine just encountered an interesting problem. I recreated the issue with a simple example code below. The problem is that the compiler complains about `i` possibly not being assigned wh...
- Modified
- 13 Feb at 09:20
How to leverage generics to populate derive class models to avoid code duplication?
I am having 2 types like and each type have different processing logic. Based on that processing I am preparing a result and returning it to the consumer (mvc application,console app etc..) - - Now...
Data Encryption in Data Layer with ASP.NET Core Entity Framework
I am currently designing a web application where the data needs to be stored encrypted. Planned technologies used: - - - - - Which would be a good approach to achieve this while still be able to use ...
- Modified
- 25 Mar at 08:55
Apply Custom Model Binder to Object Property in asp.net core
I am trying to apply custom model binder for DateTime type property of model. Here is the IModelBinder and IModelBinderProvider implementations. public class DateTimeModelBinderProvider : IModelBind...
- Modified
- 17 Jul at 08:36
Using MVC Identity code from desktop application
I'm trying to use the MVC Identity code from a desktop application. The desktop application needs to make a bunch of additions and updates to my user data. I have copied the classes over from a gener...
- Modified
- 15 Feb at 05:18
How to do try catch and finally statements in TypeScript?
I have error in my project, and I need to handle this by using , and . I can use this in JavaScript but not in Typescript. When I put as argument in typescript statement, why it is not accepting th...
- Modified
- 22 Sep at 12:40
How to fix "IDX20804: Unable to retrieve document from: '[PII is hidden]'" error in C#
Trying to get an access token to use MS Graph in my WebApi. But keep getting this error, > [TaskCanceledException: A task was canceled.] System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSucce...
- Modified
- 12 Feb at 10:26
Proper implementation of ViewPager2 in Android
I came to know about [ViewPager2](https://developer.android.com/jetpack/androidx/releases/viewpager2#1.0.0-alpha01) and tried to implement it, but didn't find any proper example. Can anyone tell me h...
- Modified
- 11 Dec at 23:10