Using a custom argument validation helper breaks code analysis
I'd like to use a custom helper to simplify argument validation, something like this. ``` public static void ThrowIfNull(this object value, string parameterName) { if (value == null) { ...
- Modified
- 16 May at 15:25
Insert a list using dapper.NET C#
I'd like to insert a list of objects in an SQL table. I know this question [here](https://stackoverflow.com/questions/21209757/dapper-insert-a-list) but I don't understand. Here is my class : ``` p...
DateTime validation not working despite a field with identical code working perfectly (in C# MVC, ASP.Net Core)
# Edit 1 Just to Clarify a couple of points, - - - --- I have my fingers crossed I'm missing something obvious because this makes no sense to me. Any help you can offer would be much appreciate...
- Modified
- 20 Jun at 09:12
C# ServiceStack.Redis store objects in hashmap
First, a link to the library: [ServiceStack.Redis](https://github.com/ServiceStack/ServiceStack.Redis) Now, I want to store objects of type `T` where T contains fields `Key` and `Value`. (for this ex...
- Modified
- 16 May at 09:22
Gradle - Could not target platform: 'Java SE 8' using tool chain: 'JDK 7 (1.7)'
I am trying to import Gradle project in Intellij Idea with local Gradle distrib and getting stacktrace with the following message: `Could not target platform: 'Java SE 8' using tool chain: 'JDK 7 (1.7...
- Modified
- 16 May at 08:13
Could not load file or assembly Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.1.0.0
After update to the new package Microsoft.EntityFrameworkCore.SqlServer 1.1.2 I got error when try to create DBContext: > System.IO.FileLoadException occurred HResult=0x80131040 Message=Could no...
- Modified
- 16 May at 07:49
How do I Mimic Number.intBitsToFloat() in C#?
I have been going crazy trying to read a binary file that was written using a Java program (I am porting a Java library to C# and want to maintain compatibility with the Java version). # Java Library...
- Modified
- 20 Jun at 09:12
How to get absolute path in ASP.Net Core alternative way for Server.MapPath
How to get absolute path in ASP net core alternative way for `Server.MapPath` I have tried to use `IHostingEnvironment` but it doesn't give proper result. ``` IHostingEnvironment env = new HostingEn...
- Modified
- 17 Jul at 15:48
ServiceStack Server-Side Events errors
Trying to deal with the problem but can't understand why out such errors. I get this error in cosole Google Chrome: EventSource's response has a MIME type ("text/html") that is not "text/event-stream...
- Modified
- 17 May at 07:30
Confusion regarding threads and if asynchronous methods are truly asynchronous in C#
I was reading up on async/await and when `Task.Yield` might be useful and came across [this post.](https://stackoverflow.com/questions/22645024/when-would-i-use-task-yield) I had a question regarding...
- Modified
- 23 May at 11:47
Hide scrollbar in FlatList (React Native) in Android
I am trying to use FlatList (React-native) in my app. I am using it horizontally and can see the scrollbar. There is an option in ScrollView to hide the scrollbar but not in FlatList. Has anyone been ...
- Modified
- 23 May at 12:18
How to reload page the page with pagination in Angular 2?
How can I reload the current page on Angular 2? if iam in page 2 (pagination) and refresh the page it will show page 1(URL pageload) but i want i refresh the page 2 and it will appear in page 2
- Modified
- 22 Oct at 00:40
ASP .NET Core use multiple CORS policies
I am trying to setup 2 CORS policies. One as an api default and the other to use on `Controllers` as I need them. The reason I want to do this is because I have an endpoint that takes in an object w...
- Modified
- 15 May at 18:25
Set global $PATH environment variable in VS Code
I'm defining a custom `$PATH` environment variable in my `~/.bash_profile` (on a Mac), like so: ``` PATH="$HOME/.cargo/bin:$PATH:$HOME/bin" ``` However, VS Code of course does not run my `.bash_pro...
- Modified
- 15 May at 15:44
Remove Unnamed columns in pandas dataframe
I have a data file from columns A-G like below but when I am reading it with `pd.read_csv('data.csv')` it prints an extra `unnamed` column at the end for no reason. ``` colA ColB colC colD ...
How to get users from a existing database for identityServer4
I try to understand how i can bind users (email, password, firstname, lastname and os on) which are stored in an existing database (located: `localhost:3306`) into my identityserver4 project so that i...
- Modified
- 19 Jul at 12:15
ImportError: No module named 'Cython'
I'm trying do `from Cython.Build import cythonize` and I get the message `ImportError: No module named 'Cython'`, but I installed the Cython with the comand `pip install Cython`. What's wrong? Python ...
Async OnActionExecuting in ASP.NET Core's ActionFilterAttribute
ASP.NET Core's `ActionFilterAttribute` has these: ``` public virtual void OnActionExecuting(ActionExecutingContext context); public virtual void OnActionExecuted(ActionExecutedContext context); publi...
- Modified
- 15 May at 12:43
Disable Button in Angular 2
I want if the input 'Contract type' is empty, the button 'Save' is not clickable Save button: ``` <div class="col-md-4"> <cic-textbox [control]="formGroup.get('contractType')"></cic-textbox...
- Modified
- 18 Mar at 10:56
How to remove nbf claim
have been looking an answer for this from everywhere, but can't seem to find one that applies to me. The thing is i'm trying to construct a JWT token with ASP.NET in c#. The problem i'm running in to ...
ValueError: could not broadcast input array from shape (224,224,3) into shape (224,224)
I have a list say, temp_list with following properties : ``` len(temp_list) = 9260 temp_list[0].shape = (224,224,3) ``` Now, when I am converting into numpy array, ``` x = np.array(temp_list...
Why is `this` not available in C# 6.0 Auto-Property Initialization?
I have the following code class: ``` public class Foo { public Nested Bar { get; } = new Nested(this); public class Nested { public Nested(Foo foo) { foo.DoSo...
- Modified
- 16 May at 12:4
ASP.NET Core: JSON Configuration GetSection returns null
I have a file `appsettings.json` that looks like this: ``` { "MyConfig": { "ConfigA": "value", "ConfigB": "value" } } ``` In my `Startup.cs` I'm building my `IConfiguration`...
- Modified
- 15 May at 07:1
File naming conventions in reactJS?
Recently, I have started learning ReactJS. The only thing that confuses me is naming and in the React app directory. - To name component files, some people follow `TitleCase.js` and some follow `cam...
- Modified
- 11 Jan at 10:31
Cannot find AddMvc() in IServiceCollection in Visual Studio 2017
I have created a brand new asp.net core application. I have added the mvc Nuget package yet I am getting the below error. Microsoft.AspNetCore.Mvc.Core 1.1.3 > 'IServiceCollection' does not contain a ...
- Modified
- 14 Aug at 17:19