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...
- Modified
- 28 Dec at 19:11
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...
- Modified
- 28 Dec at 21:44
How can I pass array as a sql query param for cosmos DB query
I want to pass array as a param to SqlQuerySpec to be able to use it in the IN expression when building query for azure cosmos db. What i'm trying to do is something like we do with regular (string, i...
- Modified
- 28 Dec at 09:24
How do I handle null or optional DLL struct parameters
How do I deal with optional `struct` arguments in dll methods called from C# using pinvoke? For example, the [lpSecurityAttributes parameter here](https://msdn.microsoft.com/en-us/library/windows/desk...
- Modified
- 13 Feb at 05:12
VSCode C# "go to definition" (F12) not working
I'm using VSCode 1.19 and trying to "Go>Go to definition" in a C# file like in Visual Studio and it does nothing. In a .js file it works well and i'm guessing if there is some workaround this.
- Modified
- 13 Apr at 01:32
Kotlin's data class == C#'s struct?
I used C# before and there we can define a `struct` which will be a value type. I'm learning Kotlin now and as far as I know kotlin `data-class` compares by value, can copy by value etc. Found some di...
ServiceStack : InvalidOperationException: StatusCode cannot be set because the response has already started
Our API works fine, recently we changed from [ServiceStack 4.5.14](https://www.nuget.org/packages/ServiceStack/4.5.14) to [ServiceStack.Core 1.0.44](https://www.nuget.org/packages/ServiceStack.Core/1....
- Modified
- 21 Apr at 00:28
Check if user belongs to an AD group .net core
I have an app where on login I want to check if the user is a part of a particular AD group or not. If yes then continue with the application, if not then show error: "I do have the LDAP connection ad...
- Modified
- 6 May at 07:21
LINQ continue after Take
Say we have an `IEnumerable<T> stuff;` Is there a concise way to Take n elements and then another m elements after the first, without re-evaluating? example code: ``` stuff.Take(10); stuff.Skip(10)...
ServiceStack Query String Mappings
I'm curious if it is possible to modify the servicesstack Route mapping rules. I'd like non-query string parameters to go in one area of the model and the query string parameters to go into another....
- Modified
- 27 Dec at 14:47
VS 2017 .Net Core 2.0 Console Application Publish Fail
I've been trying to publish a .Net Core 2.0 Console Application using Visual Studio 2017 Community Edition but it always fails (it runs perfectly inside VS2017). This is my CSPROJ: ``` <Project Sdk=...
- Modified
- 4 Jun at 08:16
How to correctly set HTTP header with managed IIS module
I've written my own managed IIS HTTP-module in C#. It's purpose is to simply set X-Forwarded-For and X-Forwarded-Proto request headers on some condition (which can not be handled with routing rules). ...
How to do multiprocessing using Python for .NET on Windows?
Now I'm developing C# app running on Windows. Some of processes are written in Python, that called via pythonnet (Python for .NET). The processes are calculation-heavy, so I want to do them in parall...
- Modified
- 26 Dec at 11:44
React Axios - C# WebAPI request token fails without a server error
I have the following code: ``` var qs = require('qs'); const ROOT_URL = 'http://localhost:56765/'; const data = qs.stringify({ username, password, grant_type: 'password' }); axios.post(`${ROOT_URL}t...
- Modified
- 30 Dec at 18:56
Error the process cannot access the file because it is being used by another process while building project by CLI on .NET Core
I got following error while running `dotnet build` command on my .NET Core project. ``` C:\Program Files\dotnet\sdk\2.1.2\Microsoft.Common.CurrentVersion.targets(4106,5 ): warning MSB3026: Could no...
How to fill an input field using Puppeteer?
I'm using [Puppeteer](https://github.com/GoogleChrome/puppeteer) for E2E test, and I am now trying to fill an input field with the code below: ``` await page.type('#email', 'test@example.com'); ``` ...
- Modified
- 11 Mar at 01:1
What are data classes and how are they different from common classes?
With [PEP 557](https://www.python.org/dev/peps/pep-0557/) data classes are introduced into python standard library. They make use of the `@dataclass` decorator and they are supposed to be "mutable n...
- Modified
- 19 Apr at 21:21
xUnit Non-Static MemberData
I have the following `DatabaseFixture` which has worked well for all tests I have created up to this point. I use this fixture for integration tests so I can make real assertions on database schema st...
- Modified
- 6 May at 18:47
MassTransit and .NET Core DI - how to resolve dependencies with parameterless constructor?
I am working on the app using .NET Core 2 and MassTransit 4(dev). Mass Transit requires parameterless constructor for consumers. I need to use e.g. logger, dbContext etc in my consumers and I would l...
- Modified
- 23 Dec at 16:33
Unity Coroutine yield return null EQUIVALENT with Task async await
What is the equivalent of `yield return null;` in Coroutine (that run each frame at Update) in an async method? The nearest I got to find is `await Task.Delay(1)`, but it DO NOT run every frame.
- Modified
- 6 May at 00:53
Entity Framework Core Find and Composite Key
The `Find()` method takes an array of objects describing the primary key you're attempting to find. The documentation is unclear as to how to handle composite primary keys. I tried searching the GitHu...
- Modified
- 27 Oct at 12:30
Is it better to use path() or url() in urls.py for django 2.0?
In a django online course, the instructor has us use the `url()` function to call views and utilize regular expressions in the urlpatterns list. I've seen other examples on youtube of this. e.g. ``` ...
- Modified
- 22 Dec at 21:37
C# 7.1 can't be published
I have ASP.NET Core C# web application. I made some changes that now use C# 7.1 features. I changed project version, so it compiles and runs fine. However, when I try to the project, I am getting an ...
- Modified
- 27 Jan at 13:45
C# Attribute hell - one class shared between mobile and server on two different SQL platforms
We share a single poco's with - - - Problem is the shared classes have become a mess. ``` [PrimaryKey, AutoIncrement] public int Id { get; set; } #if __MOBILE__ [Indexed] #else ...
- Modified
- 22 Dec at 16:13
How do I use HttpClient PostAsync parameters properly?
So I am working on writing an extension class for my project using HttpClient since I am moving over from HttpWebRequest. When doing the POST request, how do I send a normal string as a parameter? No...
- Modified
- 22 Dec at 16:13