How to redirect to a asp.net core razor page (no routes)

Here I have a razor cs page: ``` public IActionResult OnPost(){ if (!ModelState.IsValid) { return Page(); } return RedirectToPage('Pages/index.cshtml'); } ``` And a cshtml page: ``` ...

17 Oct at 22:15

Can Dapper create a model class from DB tables?

I'm looking over some alternatives to EF, and Dapper seems like a pretty good option. But I do have one question. I understand that Dapper, being a Micro ORM doesn't rely on or use a class of models, ...

6 May at 20:44

How to add a filter to a page in serenity?

I'm trying to make a filter for a page in serenity. I have a page called Companies, and one button to open another page, CompanyUsers, users from this company. [](https://i.stack.imgur.com/ZquUS.png) ...

20 Jun at 09:12

asp.net-core2.0 user auto logoff after 20-30 min

Few days ago I have decided to upgrade my web app from asp.net core 1.1 to core 2.0. Everything seems to work fine after minor changes, except authentication does not persist longer than 20-30 minutes...

Remove APK from library in Google Play Developer Console

Is there a way to remove an APK from the library in the Google Play Developer Console? To make sure: I don't mean to revert to an earlier version or unpublish an app, but to remove it from the list t...

How to listen to the window scroll event in a VueJS component?

I want to listen to the window scroll event in my Vue component. Here is what I tried so far: ``` <my-component v-on:scroll="scrollFunction"> ... </my-component> ``` With the `scrollFunction(ev...

22 Aug at 21:17

ASP.NET Core 2.0 HttpSys Windows Authentication fails with Authorize attribute (InvalidOperationException: No authenticationScheme was specified)

I am trying to migrate an ASP.NET Core 1.1 application to ASP.NET Core 2.0. The application is fairly simple and involves the following: - - `options.Authentication.Schemes = AuthenticationSchemes...

7 Sep at 14:12

Add class to an element in Angular 4

I was trying to create an image gallery with Angular 4.The logic behind this is to add a Cascading Style Sheet (CSS) class to the selected image that will show a red border on the selected (clicked) i...

24 Aug at 20:32

Difference between the created and mounted events in Vue.js

Vue.js documentation describes the `created` and `mounted` events as follows: ``` created ``` > Called synchronously after the instance is created. At this stage, the instance has finished proces...

22 Aug at 11:25

C# inline checked statement does not work

I have two test methods. The first one works fine. The second one does not throw an exception, but it should. Why doesn't the second one throw a exception? ``` [TestMethod] [ExpectedException(typeof(...

22 Aug at 13:31

Cannot consume scoped service IMongoDbContext from singleton IActiveUsersService after upgrade to ASP.NET Core 2.0

I updated a project to ASP.NET Core 2 today and I get the following error: > Cannot consume scoped service IMongoDbContext from singleton IActiveUsersService I have the following registration: ``` ...

22 Aug at 17:34

Working with return url in asp.net core

We are trying to redirect the user(using return URL) to the login page if the user is not authenticated/authorized while accessing the particular URL. However, we are not able to add the custom parame...

ASP.NET Core 2.0 JWT Validation fails with `Authorization failed for user: (null)` error

I'm using ASP.NET Core 2.0 application (Web API) as a JWT issuer to generate a token consumable by a mobile app. Unfortunately, this token couldn't be validated by one controller while can be validate...

Change Controller Route in ASP.NET Core

So I have a `HomeController`, to access it along with `Actions` I have to type . Would it be possible to change this to something else like ?

ASP.NET Core 2 - Identity - DI errors with custom Roles

I got this code in my Startup.cs: ``` services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); servic...

21 Aug at 21:15

ASP.NET Core 2.0 authentication middleware

With Core 1.1 followed @blowdart's advice and implemented a custom middleware: [https://stackoverflow.com/a/31465227/29821](https://stackoverflow.com/a/31465227/29821) It worked like this: 1. Midd...

New .csproj format - How to specify entire directory as "linked file" to a subdirectory?

With the new `.csproj` format (as well as the old), it is possible to add files as linked outside of the project folder: ``` <EmbeddedResource Include="..\..\..\Demo\Sample.cs" Link="Resources\Sample...

Object is not extensible error when creating new attribute for array of objects

I have a function that needs to extend a javascript array, including a new attribute called `selected`: ``` export const initSelect = (data) => { let newData = data.concat(); newData.map((it...

20 Sep at 16:5

.NET Core Web API key

I am developing an application that users can authenticate via username and password and we provide a JWT token that then gets validated on the server. One thing I would like to add is the ability to...

25 Nov at 14:45

How do I deserialize an array of JSON objects to a C# anonymous type?

I have no problem deserializing a single json object ``` string json = @"{'Name':'Mike'}"; ``` to a C# anonymous type: ``` var definition = new { Name = ""}; var result = JsonConvert.DeserializeA...

30 Jan at 07:25

Get ConnectionString from appsettings.json instead of being hardcoded in .NET Core 2.0 App

I have the following class in NET Core2.0 App. ``` // required when local database does not exist or was deleted public class ToDoContextFactory : IDesignTimeDbContextFactory<AppContext> { public...

Using the Null Conditional Operator to check values on objects which might be null

I've been playing with C# 6's Null Conditional Operator ([more info here](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-conditional-operators/)). I really like the...

21 Aug at 12:28

How do I get raw request body using servicestack with content-type set to application/x-www-form-urlencoded?

I have my DTO ``` Route("/testing","POST")] public class TestingRequest:IRequiresRequestStream { public Stream RequestStream { get; set; } } ``` and my service ``` public async Task<object> Po...

21 Aug at 08:37

Servicestack doesn't have ProxyFeature with dotnet core?

Can't find ProxyFeature when using servicestack with dotnet core. Need help!

21 Aug at 08:26

Update some specific field of an entity in android Room

I am using android room persistence library for my new project. I want to update some field of table. I have tried like in my `Dao` - ``` // Method 1: @Dao public interface TourDao { @Update ...

24 Oct at 18:20