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.
345
questions
0votes
1answer
22views
Scaffold-DbContext SQL database Views ? ASP NET CORE 6
I am new to .Net Core and I'd like to know scaffold EF support sql view like it supports sql table in .Net Core 6?
If it supports which command will do? For tables,Scaffold-DbContext and is it same ...
2votes
2answers
58views
The default Identity UI layout requires a partial view '_LoginPartial' error ASP.NET Core 6.0
So. I created a fresh new project with Visual Studio Pro 2019 (v16.11.9) using the model ASP.NET Core with Angular. I set the authentication option to Individual User Accounts.
I got a working ...
0votes
1answer
22views
Unable to add global AuthorizeFilter when using scaffolded Identity pages in ASP.Net Core MVC application
I created ASP.Net Core MVC project from template with enabled Identity.
I created db from migration files using update-database command.
I was able to run application, register users and login.
I ...
0votes
1answer
78views
How to reverse engineer Postgres 9.0 database
ASP.NET Core 6 MVC application uses EF Core with Npgsql.
Reverse engineering Postgres 9.0 database using
scaffolder.ScaffoldModel(connectionString.ToString(), dbOpts, modelOpts, codeGenOpts);
Throws ...
0votes
1answer
107views
Change CRUD Scaffolder (Scaffolding) in Visual Studio 2019
I am using Visual Studio 2019, with .NET Framework 4.8, creating ASP.NET MVC 5 software (not Core).
I would like to use the CRUD Scaffolder from an older version of Visual Studio (e.g. 2017 or 2015). ...
0votes
0answers
27views
How can I allow a comma in a decimal number in a scaffolded MVC view?
Database is MSSQL and project is ASP.NET MVC Core
I have a database which is filled with balls. Each ball has properties like size and weight. The weight property is a decimal value. I made a model ...
0votes
1answer
78views
VISUAL STUDIO .NET MVC Cannot Scaffold a razor view
Working with .net5 MVC app, right clicking in a controller's action and selecting
add view --> Razor view(Not empty)
After clicking Add the following error appears :
Scaffolding was working well ...
0votes
1answer
97views
.NET DB - Scaffolding - Keyless type error
My first time working on a project solo, and first time attempting to scaffold models from an existing DB.
Please see attached pictures for the error.
Scaffold-DbContext "Server=.\...
0votes
1answer
51views
Where does ASP.NET core put automatically created Databases?
I am following an MVC tutorial on ASP.NET core and currently created a movie database application using scaffolding.
The application can create and display movies entries but I can't locate the ...
0votes
1answer
91views
Scaffold common base class for all entities without discriminator
Scaffold creates Poco classes like
namespace MyDbContext
{
public partial class Customer
{
public Customer()
{
}
public string Id { get; set; }
public ...
0votes
2answers
396views
Error scaffolding an API Controller with Actions and Entity Framework
I am going through this tutorial here:
https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-6.0&tabs=visual-studio
and running Visual Studio Community version 16.9....
11votes
6answers
4kviews
Why does Scaffolding Identity for .NET Core 3.1 and .NET 5 in Visual Studio 2019 16.9.5 fail?
I'm trying to generate Identity Account\Login and Account\Register pages in a new project. I've tried both .NET Core 3.1 and .NET 5; in both cases, even when it's a new project, I receive the ...
0votes
0answers
29views
asp.net 5 MVC 1 class for multiple field values / dropdowns
I'm trying to create a MVC app (which is my first one)
I have the main class:
public class Dataset
{
public string Uuid {get; set;}
public virtual Class2 Field1 {get; set;}
public virtual ...
0votes
0answers
389views
Could not get the Reflection type for DBContext in ASP.NET Core 5.0 c#
I am using ASP.NET Core 5.0 MVC with the latest version of c# and VS2019 community, and I keep getting an error.
I tried to:
Rebuild the project
Change the c# version to 6/7/7.1
Re-install VS2019
and ...
0votes
0answers
44views
Scaffold a DBContext file with a connection string method
To connect an amazon RDS Database to my ASP.NET Core project, I have created a connection string method to obtain the connection string as seen here: https://docs.aws.amazon.com/elasticbeanstalk/...
0votes
0answers
995views
There was a problem running the selected code generator : 'Package restore Failed'
Some weeks before i encountered similar problem of scaffolding error and got the solution.
What am i trying is controllers>add>new scaffolded item >MVC controller with views , using entity ...
0votes
1answer
227views
Cannot Scaffold Login Page for .Net Core 3.1. Error: There was an error running the selected code generator package restore failed
So, I've tried everything under the sun to Scaffold this Login page in my .Net Core 3.1 MVC application. I'm using Microsoft.AspNetCore.Identity for authentication and I'm also debugging and ...
0votes
1answer
719views
Error running selected code generator The database provider attempted to register an implementation of 'IRelationTypeMappingSource'
I'm using Visual Studio 2019.
Before reinstalling visual studio my ASP.NET Core MVC project and scaffolder was working fine.
But after that I'm not able to add new scaffolded item.
By updating all ...
0votes
1answer
80views
Creating interface from DbContext
ASP.NET Core 5 MVC application uses EF Core with Npgsql data provider with different child databases.
There is a base database. Child databases contain additional columns in tables. Child databases ...
0votes
1answer
500views
Problem with Identity scaffolding in ASP.NET Core MVC
I made a MVC project, that includes 2 projects.
class library (.NET Core) - i have my models and services/options here
ASP.NET Core Web Application - Controllers, views here
I want to add identity ...
0votes
1answer
57views
Is there a way to get Entity Framework to include primary key columns when scaffolding CRUD pages?
I have a .net core 3.1 MVC app with EF 6. I am having it create CRUD pages using the "New scaffolded item" feature based on models that were already generated (I'm doing "database first&...
1vote
3answers
1kviews
Package restore failed Issue for Scaffolding items
I have issues creating a Controller with Scaffolding items.
I'm working with Visual Studio 2019 - ASP.NET Core Web Application (with MVC) - ASP.NET Core 3.1
I did the following steps:
I installed ...
0votes
1answer
78views
Tune DB queries for Scaffolding in Razor Pages (.NET and EF Core)
Is there a way to optimize DB queries generated by the out-of-the-box code generated by Scaffolding in Razor Pages? Here is the background information:
I have two tables: ToDos/Tasks and Categories. A ...
1vote
1answer
41views
Assp.net Core exeption ('Invalid column name 'ClassRoomClassId')
I have a problem with ASP.NET Core scaffolding. I just applied scaffolding on a simple relational model and I got this SqlException.
Microsoft.Data.SqlClient.SqlException: 'Invalid column name '...
0votes
1answer
392views
Asp.Net Core 3.0 MVC - Scaffolded Identity Page Routing for Culture Cookie
I have implemented this nuget package for localization in my Asp.Net Core MVC 3.0 app and have found it great.
https://github.com/LazZiya/ExpressLocalization
For all pages except my scaffolded ...
1vote
1answer
528views
There is no Identitiy option for New Scaffolding for VS 2019 Mac
I try to change the design of the login screen but ı couldn't add new scaffolding For Identity as you can see "Add" new scaffolding screen there is no Option for Identity.
The project template is ....
2votes
1answer
911views
Scaffolding MVC doesn't load ApplicationDbContext when inherit IdentityDbContext
What I did?
First I created a Asp.net web application project (3.1) with Authentication "Individual User Account"
Project will already have ApplicationDbContext that inherit IdentityDbContext
...
0votes
1answer
30views
How does a later update affect scaffolded files?
I refer to this Microsoft article.
I had Microsoft.AspNetCore.Identity.UI 3.1.1 when I scaffolded it to get the source of the Razor Pages. I have made changes to some of the Razor Pages.
The package ...
0votes
0answers
52views
How to join tables and pass to views in entity Framework scaffolding based MVC application
I created few tables in db
I am trying to create a MVC application using entity Framework
I could achieve scaffolding
But, I am unable to join tables and pass to the views.
I need a grid in view using ...
0votes
2answers
6kviews
How to use `Scaffold-DbContext` command in VS Code
I have been trying to perform scaffolding on my existing database SQL Server in VS Code software so as to create DBContext and entity domain models. However in VS Code the only available commands are ...
5votes
0answers
312views
Custom Scaffolding Extension Visual Studio 2019
I'm attempting to create a Custom Scaffold Extension for .NET Framework and Visual Studio 2019. I do not want to overwrite the default MVC T4 templates. I'm trying to do something like:
https://...
1vote
1answer
1kviews
Error trying to generate a controller in aspnet core 3 using codegenerator
I am starting a new project in asp net core 3.1.1, using a MYSQL database. I was able to scaffolding the models using the following command
dotnet ef dbcontext scaffold "Server=localhost;User=root;...
0votes
0answers
344views
How Customize Scaffolding MVC Controller in Visual Studio 2019
I want to have a Template to build my MVC project controllers.
These controllers are CRUD type. Is it possible to use custom Scaffolding?
Can I Design and Run a Template for Scaffolding myself?
...
1vote
1answer
3kviews
Core 3 : No code generator found with the name 'identity'
dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.0.100
Commit: 04339c3a26
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: ...
0votes
2answers
69views
.Net Core 2.1 project doesn't use scaffolded Identity when deploying on IIS, instead uses an old template from 2016
My problem is the following, I have a pretty huge project where I've deployed The Identity Scaffolding, so it has scaffolded in The Areas map. When I run this project in IIS Express on Visual Studio ...
3votes
1answer
761views
Why doesn't scaffolding work as expected?
I am trying to scaffold and I get the following error:
There was an error running the selected code generator: 'No parameterless constructor defined for type 'MvcProduct.Data.MvcProductContext'.'
...
0votes
1answer
100views
How to use clause Except in queryable context
I'm using Asp.Net Core com Scaffolding generate context and models.
I need to check an except comparison between 2 tables.
In SQL server this work:
SELECT Id FROM AspNetUsers a
EXCEPT
SELECT ...
4votes
1answer
483views
Keeping login/registration in JS, not razor views when scaffolding Core 3 project with Angular
Also happens with react and scaffolding a new project in VS. Any login/registration uses razor layout/views and everything else uses angulars.
New to angular, but having 2 versions of a sites layout ...
0votes
1answer
33views
Why is EF added to a project with new Razor page
Why is EF added to a project when adding a razor page. This is a new project, no auth or authorization, no contexts, no databases. Plain Jane. It runs when built. However, add a new Razor page and the ...
0votes
2answers
3kviews
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 ...
4votes
0answers
37views
Re-running scaffolding after dropping tables
After dropping tables in SQL Server, then re-running scaffolding, the entities of dropped tables do not get deleted.
I've dropped tables manually in SQL Server. Then I ran scaffolding to update the ...
1vote
4answers
7kviews
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.
...
0votes
1answer
2kviews
System.InvalidOperationException: Scheme already exists: Identity.Application: After Identity Scaffolding
I had an existing ApplicationUser, and I wanted to modify the UI page of Login. So this is why I decided to perform the scaffold operation.
ApplicationUser.cs
public class ApplicationUser : ...
0votes
1answer
1kviews
.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 ...
0votes
1answer
4kviews
Add custom fields for AspNetUser [duplicate]
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 ...
0votes
1answer
203views
VS 2017 .NET Core 2.2 Razor Pages Project lost ability to Scaffold
Any help would be appreciated. Haven't had any luck with Google.
When I put my project together I was able to Scaffold my Courses table and my Sponsors table. However, I can't find the Scaffolding ...
1vote
1answer
120views
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 ...
2votes
0answers
660views
ASP.NET Core - Scaffold REST API from Entities
Context
As a backend developer, I often have to develop new REST APIs. Because I do know approximately how much time I am going to need to do so, my estimations are often used as a base to define ...
0votes
1answer
507views
When Create in CRUD show other column then Foreign Key
Pretty sure you guys will know that i'm
fairly new in this by looking at my problem.
So when i create From CRUD i get foreign key id values which is understandable here my foreign key is Grade id but ...
4votes
0answers
421views
How to add a custom scaffolder to aspnet-codegenerator with dotnet core 2.2
I am trying to add a custom scaffolder to aspnet-codegenerator. My goal is to generate a service layer between the controllers and DbContext using the scaffolder.
I've forked the aspnet/Scaffolding ...