Difference between DbSet<T> property and Set<T>() function in EF Core?
Given this kind of context: ``` public class FooContext : DbContext { public FooContext(DbContextOptions<FooContext> opts) : base(opts) { } public DbSet<Bar> Bars { get; set; } } ``` ...
- Modified
- 25 Nov at 16:26
.NET Core equivalent to Thread.Abort
## Background I have a `Service` abstraction. Each service has it own `WorkItem`. WorkItem able to start with some data. The service is limiting the excution time of `WorkItem`. Let's say that a si...
- Modified
- 18 Feb at 10:30
How to use componentWillMount() in React Hooks?
In the official docs of React it mentions - > If you’re familiar with React class lifecycle methods, you can think of useEffect Hook as componentDidMount, componentDidUpdate, and componentWillU...
- Modified
- 25 Nov at 04:13
Why is 2 * (i * i) faster than 2 * i * i in Java?
The following Java program takes on average between 0.50 secs and 0.55 secs to run: ``` public static void main(String[] args) { long startTime = System.nanoTime(); int n = 0; for (int i =...
- Modified
- 16 Jul at 13:14
SqlExpression Creating Upper SQL Query
I have the following code: ``` SqlExpression<Postcodes> sqlExpression = db.From<Postcodes>() .Where(x => x.CityId.StartsWith(searchString)) .OrderBy(x => x.Cit...
- Modified
- 23 Nov at 11:48
Joining same table multiple times in ServiceStack.OrmLite
When joining a table to itself, the sql statment generated does not reference the tables correctly. It's working when the "main" table is different from the joining table [https://github.com/Service...
- Modified
- 22 Nov at 22:54
Get a list of all NuGet packages used in a solution
I'm looking for a way to get a list of all used NuGet packages in every project in a solution (and specifically the version) using command-line script and not manually in Visual Studio. Using the Pac...
Nuget restore fails on Azure Devops with message "unable to load the service index for source"
I have a build for a .NET solution that is running in a private agent. The solution contains both .NET Core 2.1 and .NET Standard 2.0 projects. Some of the nuget packages installed are the following...
- Modified
- 26 Nov at 10:21
response: 413 Request Entity Too Large
When POSTing a request which can contain one or more files (as base64 string) I get this error response: > ERROR 2018-11-22 09:54:18,244 [13 ] Mvc.ExceptionHandling.AbpExceptionFilter - The remote ...
- Modified
- 22 Nov at 11:42
Textfield validation in Flutter
I am working on Flutter `TextField` widget. I want to show an error message below the `TextField` widget if the user does not fill that `TextField`. I only have to use `TextField` Widget not `TextForm...
services.Configure<>() or services.AddSingleton().Get()?
As known there are two ways to get option classes in ASP.NET Core 2: 1. Using services.Configure<>() like this: services.AddOption(); services.Configure<ApplicationOptions>(Configuration.GetSection(...
- Modified
- 22 Nov at 13:13
Comparing two equal timestamps with '>' operator returns true
I am writing a query in OrmLite like: ``` var items = db.Select<CustomTable>(query => query .Where(record => record.UpdateTimestamp > lastUpdateTime) .OrderBy(...
- Modified
- 23 Nov at 08:34
How to read a binary file quickly in c#? (ReadOnlySpan vs MemoryStream)
I'm trying to parse a binary file as fastest as possible. So this is what I first tried to do: ``` using (FileStream filestream = path.OpenRead()) { using (var d = new GZipStream(filestream, Compr...
- Modified
- 27 Dec at 05:34
Independent versioning of packages in a mono-repo
We just started working on something that is maybe best described as a company-wide "open" source framework. Our main language is C# and we use Jenkins and ProGet to create and share nuget-packages. W...
- Modified
- 21 Nov at 12:15
System.Net.Http.HttpClient Disable Caching (.Net Standart Project)
In my .NET Standard project I'm using `System.Net.Http.HttpClient`. How can I disable all caching (request caching especially) in `HttpClient`? If server sends responses with no cache header problem s...
- Modified
- 27 Dec at 06:47
Change the IDENTITY property of a column, the column needs to be dropped and recreated
I am using This was my initial model definition. ``` public class Customer //Parent { public int Id { get; set; } public string Name { get; set; } public string Email { get; set; } ...
- Modified
- 21 Dec at 23:41
Getting output buffer from DBMS_OUTPUT.GET_LINES in C#
I'm trying to get the output from the `DBMS_OUTPUT.PUT_LINE()` method in my anonymous PL/SQL block through C#. I've looked at a couple of other related questions here, but am still having trouble. The...
- Modified
- 3 Dec at 17:43
Does creating an instance of a child class create an instance of the parent class?
I'm new to C#, and I wanted to know, that if I create an instance of a child class, does it also automatically create an instance of the parent class or what? Here is my code: ``` class Program { ...
Adding backward compatibility support for an older JSON structure
I have developed an app for android which stores a serialized domain model in a JSON file to the local storage. Now the thing is, sometimes I make changes to the domain model (new features) and want t...
How to test a className with the Jest and React testing library
I am totally new to JavaScript testing and am working in a new codebase. I would like to write a test that is checking for a className on the element. I am working with Jest and [React Testing Library...
- Modified
- 29 Jan at 14:21
Getting apt-get on an alpine container
I have to install a few dependencies on my docker container, I want to use python:3.6-alpine version to have it as light as possible, but apk package manager which comes with alpine is giving me troub...
- Modified
- 20 Nov at 09:19
Relation between List<> and IEnumerable<> open type
Is there any relationship between the open types `List<>` and `IEnumerable<>`? Example: ``` var type1 = typeof(List<>); var type2 = typeof(IEnumerable<>); //return false type2.IsAssignableFrom(type...
How to return a Json from a .Net Core Web API?
This is a basic question. I am new to ASP.Net Core so I created a .Net Core Web API project using the template in Visual Studio and I would like to know how to return a Json string from the Get() func...
- Modified
- 6 May at 20:37
Running python script on C# and getting output continuously
I'm trying to run a python script from C# and I want to get the output line by line and not at the end. I feel like I'm missing something important, but don't know what. This is what I have so far: An...
- Modified
- 7 May at 07:11
CORS error when adding Azure AD authentication
Trying to add Azure AD authentication to an Angular 7 webapp with a .net core 2.1 backend. However, I get the CORS error during the request. "Access to XMLHttpRequest at '[https://login.microsoftonl...
- Modified
- 22 Sep at 14:28