(C#) What is an entity?

I try to read C# ECMA to find out what an `entity` is but failed. Is this a instance of class? Or types+members? Or any single word in the code that shows no red wavy line under it?

3 Jan at 09:9

C# intellisense not working in VS Code

I am using Visual Studio Code and I have already loaded C# OMNISharp plugin to my system and it works all fine in my existing project/solutions. However, I just created a new solution and a new proje...

16 Jan at 16:36

Unable to resolve service for type IOptions[DataAccessConfiguration] in non-ASP.NET Core app

All of our business services were previously set up to use Dependency Injection with IOptions because they were being consumed by ASP.NET Core apps, like so: NotificationDataAccess.cs: ``` public cl...

3 Jan at 01:18

MVC/JQuery validation does not accept comma as decimal separator

Even though it was suggested, that this is rather a jQuery problem than an MS ASP MVC problem, I think it is an MVC Problem. I've created the whole app in asp.net core 2.0 MVC and the error persist....

23 Feb at 22:13

Nullable Owned types in EF Core

I my case I want to store an address but it has to be optional. My mapping lookes like this: But when comitting my DbContext with Address as null iam getting this error: > InvalidOperationException: T...

5 May at 14:13

Merging web.configs between projects

I have a common web project which is used as a base for several "child" web projects. Is it possible to apply a web.config transform/merge between projects? Let's say the structure looks like this: `...

Why can't I call the UseInMemoryDatabase method on DbContextOptionsBuilder?

First off, I can't use SQL Lite. Secondly the code below is giving me: > Error CS1061 'DbContextOptionsBuilder' does not contain a definition for 'UseInMemoryDatabase' and no extension method 'UseI...

14 Jun at 23:37

How to format numbers in scientific notation with powers in superscript

I need to write values like: ``` 9.6 x 10² 9.6 x 10¹² ``` I need to know if there is a way to format numbers as above in a string.

System.* reference troubles when introducing NETStandard.Library dependency

In a large solution with 52 projects (all net462), the latest version of some of our dependencies are now only built for NET standard. Therefore they depend on the NuGet package `NETStandard.Library` ...

29 Aug at 04:26

Access Configuration/Settings on static class - Asp Core

I have 3 solutions. Project.Web, Project.Core (Business), and Project.Layer(Models). In Project.Core, I have a static file that I can call like this `Business.GetAllData();` from Project.Web.Control...

How to make a lot of concurrent web requests using async and await?

I read the how to by Microsoft at [How to: Make Multiple Web Requests in Parallel by Using async and await (C#)][1] and found: private async Task CreateMultipleTasksAsync() { // Declare an H...

Use IAmazonDynamoDB or IDynamoDBContext (both?)

I started my Visual Studio project from AWS SDK template. It uses IDynamoDBContext in the function and IAmazonDynamoDB in the tests. Everything worked to save and received documents when I received th...

AspNet Core Identity, how set options.Cookie.SameSite?

In the latest templates and libraries used httpsonly flag. How can I turn it off? This same question is outdated and it did not have full configuration sample: [AspNet Core Identity - cookie not get...

1 Jan at 19:10

How to get more detailed exception in ABP?

I created a CrudAppService. When I invoke its dynamic API by using , I get a generic `500` error with this description: ``` { "result": null, "targetUrl": null, "success": false, "error": { ...

How to use dependency injection with inheritance in C#

# Introduction Hi everyone, I'm currently working on a persistence library in C#. In that library, I have implemented the repository pattern where I'm facing a SOLID issue. Here is a simplified exa...

Dynamically access table in EF Core 2.0

I am using `System.Linq.Dynamic.Core` to dynamically add in lambda expressions to queries in EF. I want to also be able to select the table by name. I found this answer: [https://stackoverflow.com/a...

How to programmatically interact with winlogon?

I have a Windows Service that I want to use to programmatically unlock the workstation, using the account username and password. This article [https://technet.microsoft.com/en-us/library/dn751047(v=w...

Cast Task<T> to Task<object> in C# without having T

I have static class full of extension methods where each of the methods is asynchronous and returns some value - like this: ``` public static class MyContextExtensions{ public static async Task<boo...

2 Jan at 13:23

Visual Studio 2017 publish ASP.NET Core app with C# 7.2

I have a Asp.Net MVC Core website that's using `public static async Task Main()`. For that to work I've set the language version to C# 7.2 (in the properties -> build -> advanced dialog, double checke...

Listing USB devices via their USB class

I am trying to dynamically list the USBs connected to the computer that match a certain [UsbDeviceClass](https://learn.microsoft.com/en-us/uwp/api/windows.devices.usb.usbdeviceclass) The information a...

23 Dec at 00:1

How to get an instance of IConfiguration in asp.net core?

I making a unittesting project to test my webapi and i need to initialize a controller the problem is that in the constructor it receive a IConfiguration that it is provide by dependency-injection and...

Not much difference between ASP.NET Core sync and async controller actions

I wrote a couple of action methods in a controller to test the difference between and controller actions in ASP.NET core: ``` [Route("api/syncvasync")] public class SyncVAsyncController : Controlle...

Searching an int column on the basis of a string value

I have a View `View_Booking` in sql server 2014: ``` bkID bkSlot bkStatus ---- ------ -------- 2 Lunch 1 4 Lunch 1 6 Dinner 0 7 Lunch 1 ``` While ...

Net core generic repository pattern how to inject DbContext without knowing its type at compile time?

I'm working on a web api project decoupled and the bussiness logic its decoupled in extensions (separated projects, that gives me a lot of shared code between projects), thats why I'm working on a dat...

Thread.Sleep vs. Task.Delay when using timeBeginPeriod / Task scheduling

Given the attached LINQ-Pad snippet. It creates 8 tasks, executes for 500ms and draws a graph on when the threads were actually running. On a 4 core CPU it may look like this: [](https://i.stack.img...