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.
335
questions
0
votes
1answer
39 views
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 ...
0
votes
1answer
71 views
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 ...
0
votes
1answer
45 views
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 ...
1
vote
1answer
61 views
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 ...
0
votes
1answer
18 views
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&...
0
votes
1answer
90 views
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 ...
0
votes
0answers
50 views
ASP.NET scaffolding: InvalidOperationException when trying to use connection strings alias
I have an ASP.NET app in .NET 5.0.
I want to use Scaffold feature to generate my DB classes.
This command works like a charm:
dotnet ef dbcontext Scaffold "Data Source=MyServer;initial catalog=...
0
votes
0answers
43 views
Scaffold MongoDB controllers from existing strongly typed model definition
I'm in the process of migrating an ASP.NET Core 3.1 App from mySQL to MongoDB. My problem is that I do have all these useful boilerplate models, views and controllers - directly scaffolded from the ...
0
votes
1answer
46 views
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 ...
1
vote
1answer
24 views
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 '...
0
votes
1answer
244 views
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 ...
0
votes
0answers
13 views
After updating model class from .mdf in my MVC project I am unable to create a controller class [duplicate]
Error is
There was an error running the selected code generation 'Object reference not set to an instance of an object '
1
vote
1answer
255 views
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 ....
2
votes
1answer
551 views
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
...
0
votes
1answer
28 views
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 ...
0
votes
0answers
23 views
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 ...
0
votes
1answer
2k views
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 ...
0
votes
0answers
29 views
Scaffold-DBContext updating does not generate table/scheme attributes in header
Creating a .net core 3.1 web API solution. I am using the database first approach as we already have an established database that I will be hooking onto.
I initially created the classes a few months ...
3
votes
0answers
99 views
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://...
0
votes
0answers
14 views
InvalidOperationException: The entity type 'StringBuilder' requires a primary key to be defined [duplicate]
I have a class "Project" that I am trying to use a StringBuilder object as my Description class property. The class already has an ID field defined but I am getting an error about 'StringBuilder' ...
0
votes
1answer
672 views
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;...
0
votes
0answers
12 views
ASP. NET Core asp-action is reexecuted after go back
I use the standard scaffolded view for mvc by visual Studio for an entity.
When I'm in the index view and click on the edit or detail link the correct page is opened.
If I press the back button in ...
0
votes
0answers
189 views
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?
...
1
vote
1answer
2k views
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: ...
0
votes
2answers
61 views
.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 ...
3
votes
1answer
508 views
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'.'
...
0
votes
1answer
51 views
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 ...
4
votes
1answer
376 views
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 ...
0
votes
1answer
32 views
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 ...
0
votes
1answer
1k views
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 ...
3
votes
0answers
21 views
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 ...
1
vote
4answers
4k views
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.
...
0
votes
1answer
892 views
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 : ...
0
votes
1answer
825 views
.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 ...
0
votes
1answer
2k views
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 ...
0
votes
1answer
155 views
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 ...
1
vote
1answer
37 views
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 ...
2
votes
0answers
434 views
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 ...
0
votes
1answer
278 views
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 ...
3
votes
0answers
359 views
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 ...
1
vote
2answers
738 views
ASP.NET Core 2 - How to remove scaffolded routes?
ASP.NET Core 2.x includes some pre-made scaffolded routes, like the login page, settings, etc. I am working on something that only has OAuth login buttons, and no settings. This means that I don't ...
1
vote
2answers
67 views
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 ...
0
votes
1answer
32 views
Trying to generate scaffold controller and got an error
I am trying to generate a controller with scaffold from Entity framework and I got this error : exception has been thrown by the target of an invocation
I have already tried everything I searched on ...
0
votes
1answer
565 views
HiddenInput not working on ASP.NET Core 2.2 Scaffolding
When using scaffolding in asp.net core 2.2, is there a way to make properties scaffold as Hidden Inputs?
Unfortunately [HiddenInput(DisplayValue=false)] does not seem to work...
0
votes
1answer
170 views
No service while customize a new User Context Identity
I'm stuck trying to create a User and a new context to add fields to the AspNetUsers table.
I am surprised that the error indicates that there is no service for the context I created when I think I ...
4
votes
1answer
2k views
Method 'Clone' in type 'Microsoft.EntityFrameworkCore.Infrastructure.Internal.SqliteOptionsExtension'
I am trying to create an asp.net core 2.1 app using SQLite database. This is my first time doing it with SQLite. I am getting an error in the trying to scaffold controller and view from Model.
...
1
vote
1answer
123 views
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 ...
0
votes
0answers
1k views
deps.json does not exist in ASP.NET Core 2
I'm creating a new project DB First in ASP.NET Core 2 with Razor Pages and when I try to generate the code from the existing DB -
Scaffold-DbContext "Server=server\V;Database=tblIssues;...
1
vote
1answer
1k views
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 ...
0
votes
0answers
600 views
Scaffolding in Asp.net Core and EntityFramework Core is giving error
I have a project that I have been working on for quite a while. It is an Asp.net Core project currently using SDK 2.1.403. I am using VS 2017 15.9.0 preview 3 as by IDE. The project utilizes Entity ...