ASP.NET Core Identity Add custom user roles on application startup

In an ASP.NET Core application, I want to create certain roles as a basis to manage different user-permissions. Sadly, the documentation inform detailled how to use custom roles e.g. in controllers/ac...

using ServiceStack.Text: determine JSON is Array, Object or String?

using JSON.net I could do this as answered in this [link](https://stackoverflow.com/questions/20620381/determine-if-json-results-is-object-or-array) ``` string content = File.ReadAllText(path); var t...

No Network Security Config specified, using platform default - Android Log

I am trying to make a database via 000webhost.com. I keep getting this message showing in the event log whenever I run the app from android studio. Does anyone knows how to solve this problem? Much ap...

19 Aug at 06:13

Should I use virtual, override, or both keywords?

In the last weeks something is bugging my brain about `virtual` and `override`. I've learned that when you do inheritance with virtual function you have to add `virtual` to let the compiler know to se...

8 May at 20:37

Sending Email to SpecifiedPickupDirectory with MailKit

I was using SmtpClient till now with ASP.NET MVC 5. For testing email send functionality on local system, I was using `client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;` Now, I wan...

8 Oct at 07:58

How to use aria-expanded="true" to change a css property

I want to use `aria-expanded="true"` to change a css property like an active class : ``` <li class="active"> <a href="#3a" class="btn btn-default btn-lg" data-toggle="tab" aria-expanded="true"> ...

11 Sep at 09:48

Provide schema while reading csv file as a dataframe in Scala Spark

I am trying to read a csv file into a dataframe. I know what the schema of my dataframe should be since I know my csv file. Also I am using spark csv package to read the file. I trying to specify the ...

ServiceStack Raw Client query string

This should be simple, but I must be using the wrong key words to find the answer. How can I output the raw query string that the jsonserviceclient is generating when sending a request to the server?...

7 Oct at 22:0

How can I filter columns (rather than rows) in EPPlus?

Filtering rows in a particular column is as easy as pie in EPPlus: ``` private ExcelWorksheet prodUsageWorksheet; . . . prodUsageWorksheet.Cells["A6:A6"].AutoFilter = true; ``` This allows me to fi...

11 Dec at 05:57

Keyboard shortcut to clear cell output in Jupyter notebook

Does anyone know what is the keyboard shortcut to clear (not toggle) the cell output in Jupyter Notebook?

3 Dec at 16:0

Bootstrap: change background color

I'm new to learning Bootstrap and I'm looking have 2 col-md-6 divs next to one another having one background-color blue and the other white. How can I change one background color and not both? I'm tr...

7 Oct at 18:39

How do I Pandas group-by to get sum?

I am using this dataframe: ``` Fruit Date Name Number Apples 10/6/2016 Bob 7 Apples 10/6/2016 Bob 8 Apples 10/6/2016 Mike 9 Apples 10/7/2016 Steve 10 Apples 10/7/2016 Bob 1 Ora...

How to resize Webview height based on HTML content in Windows 10 UWP?

I am currently working on Windows 10 UWP App and facing an issue with WebView that when I have less HTML content, I am getting more height in javascript. My Code is as follows ``` WebView webView = n...

Why BindNever attribute doesn't work

I do not want do bind the `Id` property on my `CustomerViewModel` so I added a `[BindNever]` attribute but it is not working. What could be the solution? I have the following: ``` // PUT api/custo...

Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $

What is this error ? How can I fix this? My app is running but can't load data. And this is my Error: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $ This is my frag...

21 Feb at 01:59

Is there more shortcuts like %appdata%?

I am trying to manage some data with C# porgram. Data is usually in Desktop or similar basic Windows location. Right now I type full path to specific folders, but I know that there are shortcuts like ...

7 Oct at 13:16

What is a suitable pattern for injecting loggers within dynamically-discovered .NET Core class libraries called from ASP.NET Core web apps?

## Overview I'm trying to port a number of projects based on the .NET Framework to .NET Core. This involves porting a number of class libraries as well as top-level console/web applications that c...

23 May at 12:9

How to show DatePickerDialog on Button click?

I'm developing an app that requires user to select date(dd/mm/yyyy). I want to show a dialog box with DatePicker on button click. once date is selected it must show in EditText. I'm using Android Stu...

Why does 'unbox.any' not provide a helpful exception text the way 'castclass' does?

To illustrate my question, consider these trivial examples (C#): ``` object reference = new StringBuilder(); object box = 42; object unset = null; // CASE ONE: bad reference conversions (CIL instrcu...

17 Oct at 19:53

How to generate duplicate items in a list using LINQ?

this is LINQ query I have used ``` var result = (from price in inventoryDb.Pricing.AsNoTracking() where price.Quantity > 0m select new { ...

7 Oct at 10:11

How to manually trigger click event in ReactJS?

How can I manually trigger a click event in ? When a user clicks on element1, I want to automatically trigger a click on the `input` tag. ``` <div className="div-margins logoContainer"> <div id="el...

28 Dec at 17:13

NHibernate HiLo generator generates duplicate Id's

I have an application running on nHibernate v4.0.4.4000 - it is running in production on three seperate webservers. For ID-generation, I'm using the default HiLo implementation (unique id across table...

14 Oct at 15:28

How to set the default value of an attribute on a Laravel model

How to set the default value of an attribute on a Laravel model? Should I set the default when creating a migration or should I set it in the model class?

14 Jun at 21:0

Is there a TypeScript equivalent to C#'s attributes

In C# there is a syntax available to define attributes of a property. ``` [Required] string personName ``` It describes that personName is required. We can get the attributes of a property in any g...

20 Feb at 11:11

How can I implement a transaction for my repositories with Entity Framework?

I am trying to utilize the repository design pattern in my application for 2 reasons 1. I like to de-couple my application from Entity in case I decide to not use Entity Framework at some point 2. I...