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...
- Modified
- 24 Oct at 11:38
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...
- Modified
- 23 May at 10:34
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...
- Modified
- 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...
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...
- Modified
- 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"> ...
- Modified
- 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 ...
- Modified
- 16 Aug at 16:17
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?...
- Modified
- 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...
- Modified
- 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?
- Modified
- 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...
- Modified
- 7 Oct at 18:39
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...
- Modified
- 12 Oct at 08:47
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...
- Modified
- 7 Oct at 19:48
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...
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 ...
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...
- Modified
- 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...
- Modified
- 8 Oct at 09:11
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...
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 { ...
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...
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...
- Modified
- 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?
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...
- Modified
- 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...
- Modified
- 7 Oct at 05:19