Questions tagged [asp.net-mvc-scaffolding]

ASP.NET MVC Scaffolding is a scaffolding package for quickly generating a basic outline of your software that you can then edit and customise.

ASP.NET MVC Scaffolding is a scaffolding package for quickly generating a basic outline of your software that you can then edit and customise.

A tutorial is found on Steven Sanderson's blog.

Installation

MVC Scaffolding can most easily be installed through its NuGet package.

Install-Package MvcScaffolding
364 questions
1
vote
2 answers

Could not find any resource appropriate for the specified culture or neutral culture

Yesterday, I got the error message Could not get the reflection type for DbContext when trying to add a new controller. I have many controllers in my solution already, so I don't know why this suddenly occured. Then I followed the solution given…
1
vote
4 answers

Where to register the context with dependency injection

According to this tutorial I should: Register your context with dependency injection The Tutorial describes that I should locate the method ConfigureServices() and put in there the code advised. Here's my startup.cs: using Microsoft.Owin; using…
xralf
  • 3,312
  • 45
  • 129
  • 200
1
vote
1 answer

.NET Core Identity - Scaffold pages without overriding existing files

I have a .NET Core 2.2 MVC app using Identity. Since I'm using Visual Studio for Mac I had to use the CLI to scaffold out the identity files. Initially I only needed a few files so I used the following command to generate the files I…
1
vote
1 answer

Add custom fields for AspNetUser

I am a newbie in ASP.NET Core. How can I add custom fields to my user model both in code and UI? Current user management UI is something like this, but I want to add some extra fields, like credit or scores, in model, DB & UI: And this is my…
AVEbrahimi
  • 17,993
  • 23
  • 107
  • 210
1
vote
1 answer

I want to scaffold column in Details page but not in Index Page of an AspNetCore Web App

I am using CRUD Scaffolding in ASPNETCORE, I have a model, and in this model I want some fields to be displayed only in Details page and not in Index Page, using [ScaffoldColumn(false)] attribute disables scaffolding in both pages, is this possible?
1
vote
2 answers

DropDownList value insert in database as foreign key

I am trying to insert a categoryID to the table Post, but my code is creating a new category instead of using the selected value from the dropdownlist. I am starting to study ASP.NET MVC, so I don't know how I can solve this. I can get the real…
JNeves
  • 41
  • 5
1
vote
1 answer

How do I revert to controller based identity and authentication in .NET Core 2.1

I would like to use a Controller based Identity with .NET Core 2.1. I would like to scaffold the UI but the scaffolder creates Razor Page based identity. I would like to use controllers instead of Razor Pages. Is it possible to scaffold this?
gyurisc
  • 11,234
  • 16
  • 68
  • 102
1
vote
1 answer

How to Create Custom Generate/Scaffold Templates(Razor) in ASP.NET MVC in Visual Studio 2017?

How to Create Custom Generate/Scaffold Templates(Razor) or Modify Default in ASP.NET MVC in Visual Studio 2017? I want to add or modify code generator for ASP.Net MVC project not ASP.NET Core. I found Razor Template in…
1
vote
1 answer

How to Update ASP.MVC scaffoldings from Bootstrap 3 to Bootstrap 4 on VS2017?

I've been searching (googling) on how to update my asp.net mvc scaffolding's from BS-3 to BS-4 !! i try to update from nuget but it only updates bootstrap files scaffolding remains same for bootstrap 3. I found an answer on stack-overflow but it…
1
vote
1 answer

Cannot Scaffold (EF, Core 2.1) model that contains a 'bool' item

My model looks like this: namespace Flow.Models { public abstract class Project { public int ID { get; set; } public String HashID { get; set; } public string FileLoc { get; set; } //Use HashedID above. …
user1489765
  • 291
  • 2
  • 12
1
vote
1 answer

How can I create my own Scaffolding on Visual Studio 2017?

I'm using a scaffolding in visual studio 2017 now, but I want to set up my own scaffolding template and controller and I want to replace the previous one
1
vote
0 answers

How do I keep my existing Entity Framework context from being overwritten each new scaffold?

I am using Database First with ASP.NET Core 2 and Entity Framework. When I initially use scaffold-dbcontext -connection.... in the Package Manager Console, all my classes are generated as expected and my context is created with the various…
johnny
  • 19,272
  • 52
  • 157
  • 259
1
vote
2 answers

There was an error running the selected code generator 'Unable to retrieve metadata for 'ERP.EF.StockItem' Ambiguous match found

I'm trying to compile a controller and I get the following error: There was an error running the selected code generator 'Unable to retrieve metadata for 'ERP.EF.StockItem' Ambiguous match found What am I missing?
1
vote
0 answers

Error when trying to create New Scaffolded Item - .NET MVC Entity Framework Core

Following this Virtual Academy, and about 37:00 in they go to create a new scaffolded item from the Album model and context they created. Mine fails. I've googled, and tried creating 3 separate projects, targeting .net core 2.0, 1.1, and 1.0…
1
vote
2 answers

How to join two tables with one table having distinct value in LINQ sql?

I have two tables emp_details where i have emp_id, emp_name and emp_addresss as columns and another table emp_hierarcy where i have emp_id, emp_mgid with multiple rows with same emp_id. I want to write a linq query i.e, to join two table upon emp_id…
Suhas
  • 83
  • 2
  • 17