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

Using view models in MvcView scaffolding templates

I have viewmodel public class ClientIndexViewModel { [Key] public int SurrogateId { get; set; } // not primary key just used in templating public IEnumerable Clients { get; set; } } And I have created a new MvcView t4 template…
user1752532
1
vote
2 answers

scaffolding a view from model with subobjects

I'm wondering how to scaffold a view from a model, with sub objects. For instance I have Person (string name, DateTime birthdate, Address address) Address (string street, int postalcode) I scaffold this model to a view, I will have the name, the…
clement
  • 4,204
  • 10
  • 65
  • 133
1
vote
1 answer

Command line scaffolding in asp.Net VNext

I am trying to create a Web Application in Visual studio 2015 Preview. I am trying to create views using the Command Line Scaffolding. I used the following command: k gen controller -name ProductController -m ViewModels.Product -dc ProductContext…
1
vote
0 answers

bind model including HttpPostedFile

I have a class containing a property as HttpPostedFile public class VehicleModel { public int Id {get;set;} public HttpPostedFile picture {get;set;} } when i want to generate a scaffolded item it tells me that HttpPostedFile doesn't have…
badr slaoui
  • 1,023
  • 11
  • 27
1
vote
0 answers

Asp.net mvc-5 Scaffolding template wrongly mapped a Parent entity

I have an sql server database, which contains a table named “Technology” , which acts as a parent to many child tables such as Servers, VM, Switch, firewall, etc. The technology Entity class is as follow:- public partial class Technology { …
1
vote
0 answers

MVC No Add Controller Menu or Scaffolding Menu

Just wondering if any of you has experience the same trouble, since I downloaded the Visual Studio Express 2013 For web, the "Add Controller or Scaffolding" never appear in the menu when I created a new project. I have updated the MVC 5.2.2 still no…
1
vote
1 answer

Proper way to generate a view from a many to many relationship?

I have two tables - ContactInformation & EmailAddress - which have a many to many (* : *) relationship. After making this association in the ADO.NET data model and generate the db from it, a table titled ContactInformationEmailAddresses which maps…
1
vote
1 answer

Date fields are always required in MVC Scaffolding

I have a model where i have scaffold it with Mvc Scaffolding, All Fields with DateTime Property in my model are marked as Required i mean i can not enter a null value in it. Even though in my model there is no [Required] attribute for Date fields. I…
Naser Dostdar
  • 61
  • 1
  • 2
  • 12
1
vote
1 answer

Scaffolding in Visual studio 2013

I am trying to develop a code generation utility in which I need to invoke creation of controllers and views from command line in VS 2013. I tried MvcScaffolding package but I am getting errors while installing. Is there any option in VS 2013 to…
1
vote
2 answers

How do I specify which field should be displayed with MVC Scaffolding

I am creating an MVC4 application using EF Code First database. I am working with some foreign key declarations. I wish to use define the field to display in the dropdown in the scaffolding in the model declarations. For instance: My simplified…
1
vote
0 answers

Powershell commandlet to write code within a method

I have been writing a couple of powershell funcions to automate code generation for ASP.NET MVC 4, I am using cmdlets from MvcScaffolding and they are being very helpful, but there is one thing missing, I would like to be able to write code within a…
Fernando Vezzali
  • 2,219
  • 1
  • 29
  • 32
1
vote
1 answer

Unable to Add Controller (with scaffolding) ASP.NET MVC

This has been addressed in multiple other questions, but alas, I have tried all the solutions posted there with no success. I'm developing an ASP.NET MVC application, using Code-First EF. I am trying to take advantage of the scaffolding built in so…
1
vote
1 answer

How do I get the Area (or the path) of where a View is being scaffolded?

PROBLEM: I am customizing the MVC 5 templates for scaffolding views. I need to be able to get the area name for the area where the view is being created. EG, I want to get be able to set the value for the variable areaName for the Url Action…
awrigley
  • 13,481
  • 10
  • 83
  • 129
1
vote
2 answers

Using MvcScaffold, I'm getting "Sequence contains no elements" for most files, for each model

Example error; I try to Scaffold Controller Region -Repository Region class public class Region { public int RegionId { get; set; } public string RegionCode { get; set; } public string ApiUrl { get; set; } public Universe[]…
MrGraversen
  • 257
  • 3
  • 16
1
vote
1 answer

MVC4 - Controller Scaffolding, Custom Data context class issue: Unable to retrieve metadata

When I try to create a controller by scaffolding, I get the following error: Unable to retrieve metadata for 'TurkUp.Models.Admin.CreateCourseViewModel'. Schema specified is not valid. Errors: The mapping of CLR type EDM is ambiguous because…