tagged [asp.net-core-mvc]
Can I execute npm commands directly from the visual studio
Can I execute npm commands directly from the visual studio Can I execute npm commands (e.g. npm init, npm install) directly from Visual Studio 2017 on Asp.Net Core 2.0 project? May be from command lin...
- Modified
- 20 Nov at 08:56
Resolving instances with ASP.NET Core DI from within ConfigureServices
Resolving instances with ASP.NET Core DI from within ConfigureServices How do I manually resolve a type using the ASP.NET Core MVC built-in dependency injection framework? Setting up the container is ...
- Modified
- 8 Jul at 12:52
How to sign out other user in ASP.NET Core Identity
How to sign out other user in ASP.NET Core Identity How can i sign out another user (not the currently logged one) in ASP.NET Core Identity. I know there is a [SignOutAsync()](https://github.com/aspne...
- Modified
- 13 Jan at 07:47
How to add link parameter to asp tag helpers in ASP.NET Core MVC
How to add link parameter to asp tag helpers in ASP.NET Core MVC I have a lot of experience with . Now I learn and have to pass a parameter to link in page. For example I have the following How can I ...
- Modified
- 16 Nov at 16:38
The AuthorizationPolicy named: 'Admin' was not found
The AuthorizationPolicy named: 'Admin' was not found I am learning Authentication/Authorization in .NET Core MVC. I am trying to create a controller that can only be accessed by 'Admin', but get the f...
- Modified
- 11 Aug at 18:47
ASP.NET Core - Custom model validation
ASP.NET Core - Custom model validation In MVC when we post a model to an action we do the following in order to validate the model against the data annotation of that model: If we mark a property as [...
- Modified
- 11 Oct at 18:1
Net Core: Convert String to TagBuilder
Net Core: Convert String to TagBuilder The following code converts a `TagBuilder` to a `String`. What is the opposite? How do I convert reverse, a `String` to a `TagBuilder`? Looking for a solution. [...
- Modified
- 10 Aug at 12:18
How to Per-Request caching in ASP.net core
How to Per-Request caching in ASP.net core My old code looks like this: ``` public static class DbHelper { // One conection per request public static Database CurrentDb() { if (HttpContext.Cur...
- Modified
- 24 Aug at 08:43
Produces Data Annotation
Produces Data Annotation I've been learning about Web API recently, and making plans to increase the scalability of my MVC apps, using it. When I finally got into creating a Web API controller, though...
- Modified
- 16 Jul at 19:29
ASP NET Core 2 with Full Framework
ASP NET Core 2 with Full Framework I am unable to find any documentation, or examples, of an ASP.NET MVC Core app running under the full framework. It is supposed to be supported, but as I said I cann...
- Modified
- 6 Sep at 23:1
'DbContextOptionsBuilder' does not contain a definition for UseNpgsql()
'DbContextOptionsBuilder' does not contain a definition for UseNpgsql() I am facing an issue while giving the connectionstring to get it connect to PostgreSQL through the `AddDbContext()` method in Co...
- Modified
- 2 Dec at 09:15
asp.net core 1.0 web api use camelcase
asp.net core 1.0 web api use camelcase On `RC2` the same code returns json format with camel case. After netcore 1.0 release i started new project and the same code is returning json in lowercase. [](...
- Modified
- 5 Dec at 08:50
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 How to get absolute path in ASP net core alternative way for `Server.MapPath` I have tried to use `IHostingEnvironment` but ...
- Modified
- 17 Jul at 15:48
OverrideAuthorization attribute in .NETCore
OverrideAuthorization attribute in .NETCore In the controller code below, only users who are in the "Administrator" role can access the `GetData()` action method, because of the controller-level `Auth...
- Modified
- 13 Nov at 15:51
Migrate html helpers to ASP.NET Core
Migrate html helpers to ASP.NET Core I'm converting a project to ASP.NET Core. I need to migrate lots of reusable html helpers, but html helpers do not exist in Core. Some are complex, some simple. He...
- Modified
- 27 Feb at 20:24
Unit testing routing in ASP.NET Core 1.0 (ex MVC 6)
Unit testing routing in ASP.NET Core 1.0 (ex MVC 6) As the architecture of ASP.NET Core 1.0 (ex MVC 6 / ASP.NET 5.0) changed significantly, how would one go about unit testing the routing? As an examp...
- Modified
- 21 Feb at 19:20
services.AddControllersWithViews() vs services.AddMvc()
services.AddControllersWithViews() vs services.AddMvc() In order to be able to add controllers in my ASP.NET Core app, I can add either or in `ConfigureServices` method at `Startup` class. It looks li...
- Modified
- 7 Jun at 21:8
How to get the database context in a controller
How to get the database context in a controller I am trying all day to figure out to get the `ApplicationDbContext` in the `ManageController.cs` of a default MVC 6 project. I went online and Googled a...
- Modified
- 20 Aug at 15:32
Get the full route to current action
Get the full route to current action I have a simple API with basic routing. It was setup using the default Visual Studio 2015 ASP.NET Core API template. I have this controller and action: So to reach...
- Modified
- 17 Mar at 10:35
How do you enforce lowercase routing in ASP.NET Core?
How do you enforce lowercase routing in ASP.NET Core? In ASP.NET 4 this was as easy as `routes.LowercaseUrls = true;` in the `RegisterRoutes` handler for the app. I cannot find an equivalent in ASP.NE...
- Modified
- 6 Aug at 11:33
Can I generate script of a migration with EF code first and .net core
Can I generate script of a migration with EF code first and .net core I'm building a MVC application with .Net Core and I need to generate the script of a migration. With EF6 I did run the command but...
- Modified
- 7 Sep at 16:41
ASP.NET Core Application Lifecycle
ASP.NET Core Application Lifecycle Is there any current "ASP.NET Core" document(s) about the life cycle? I would like to be able to tie into the life cycle at the right points. Is it similar to the ex...
- Modified
- 8 Nov at 11:37
HttpContextBase namespace could not be found
HttpContextBase namespace could not be found ``` public string GetCartId(HttpContextBase context) { if (context.Session[CartSessionKey] == null) { if (!string.IsNullOrWhiteSpace(context.User.I...
- Modified
- 2 Aug at 05:4
Asp.Net MVC Core enabling double escape
Asp.Net MVC Core enabling double escape I am working on a asp.net mvc core application and trying to allow double escaping. My Edit url has a phone number as hyperlink (Ex: +123). I know how to do wit...
- Modified
- 5 Apr at 05:29
Should I use AddMvc or AddMvcCore for ASP.NET Core MVC development?
Should I use AddMvc or AddMvcCore for ASP.NET Core MVC development? I am learning ASP.NET Core MVC from a book, the code snippet in question is as follows: Because t
- Modified
- 2 Apr at 16:23