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
5
votes
2 answers

Context menu has no "Add Scaffolding" nor "Add Controller" options

I'm trying to get started with ASP.NET/C#, and I'm doing so by following along some guides and tutorials. One major issue I keep running into is that I have no Add Scaffolding in the context menu, nor Add Controller. I can't figure out a workaround…
5
votes
3 answers

MVC5 T4 ModelMetadata.Properties IsNullable or IsRequired

I am trying to create a replacement T4 template for the MVC5 Controller. I have everything working except for one issue. I need to generate code for each property in the Model, and looping through ModelMetadata.Properties is actually really easy.…
Rabbi
  • 4,622
  • 9
  • 35
  • 45
5
votes
1 answer

MVC Scaffolding - Quick and Easy way to implement Paging?

I am developing an ASP.NET MVC 4 application using MVC scaffolding. Currently it returns all rows in a single fetch and displays them in the grid. However, I want to implement paging within the same so that it doesn't create any problem when the…
Nirman
  • 6,715
  • 19
  • 72
  • 139
5
votes
1 answer

Customize T4 Scaffolding With PowerShell

I want to create a Custom Scaffolder that uses arbitrary PowerShell logic. It can render T4 templates (multiple ones if I want), with the result being output: As a new file in your project as a new code block inserted into an existing class my…
4
votes
0 answers

MVCScaffolding and AutoMapper Mapped ViewModel

Does anyone know if there are Scaffolding templates etc for MVCScaffolding that create ViewModels per view and adds AutoMapper mapping for them? I want to follow Jimmy Boggards recommendation that every view should have a dedicated ViewModel and it…
GraemeMiller
  • 11,973
  • 8
  • 57
  • 111
4
votes
2 answers

Entity framework not updating model's complex collection property

probably this question has been asked in many forms before but still I think their is no clear solution with the scenario. I have following entity classes. public class Project { public int ProjectId { get; set; } …
4
votes
2 answers

Is MVC 3 Scaffolding usable in n-layer applications?

I've seen some examples of ASP.NET MVC3 Scaffolding but those are always simple basic applications. What about layered/tiered solution with several Projects: /Data /Repository /Services /UI (MVC3) The basic scaffolding pushes everything…
4
votes
2 answers

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'.' Here you can see an image of it: The following is…
4
votes
1 answer

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 isn't DRY, but with the default scaffolding doing…
4
votes
0 answers

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 entities in the project. I ran this several times…
4
votes
0 answers

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 repository into my own repository and tried to add…
4
votes
1 answer

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. Finding the generator 'controller'... Running the…
4
votes
1 answer

Syntaxlistpool.free separated syntax builder. While scaffolding Asp.Net Core 2.1

All packages are update till today, and using EF Core Code first. But while scaffolding API controller. Syntaxlistpool.free separated syntax builder. While scaffolding Asp.Net Core 2.1
Abhijeet
  • 13,562
  • 26
  • 94
  • 175
4
votes
0 answers

Visual Studio giving error when trying to scaffold viewmodel

I am trying to add a view using a viewmodel as the Model class to my MVC project, but when I do I get a popup with this error: "Error There was an error running the selected code generator: 'A configuration for type Blog.Domain.Entities.Post' has…
4
votes
2 answers

Getting Custom Attributes in VS2013 T4 Scaffolding Templates

I'm in the process of porting my previous MVC4.5 T4 Scaffolding templates to be used in VS2013. All is going well, luckily the logic behind it has not changed much, but lots of namespaces, objects and properties were renamed just like I…