Questions tagged [t4scaffolding]

1

votes
1

answer
1.5k

Views

Access metadata (dataannotations) in my model from t4 scaffolding templates

How can I access metadata (dataannotations attributes) in my asp.net mvc model class from a T4 scaffolding template? I'm trying to read the ScaffoldColumn attribute in the T4 template so it should know if must render some columns in the index view Thanks
Rodrigo Juarez
1

votes
1

answer
793

Views

T4 Scaffolding - How to detect Nullable Types

I am trying to generate a Class by loading another Class as model, here is the class\model i am using using System; using System.Text; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace Sma.Domain.Model { public class Smartistdetails { public Smartistdetails()...
Moon
1

votes
1

answer
675

Views

T4 Scaffolding - Powershell Script

I am working on T4Scaffolding, i am using model to generate code, the thing is that the model, thats is POCO for DB, it must have a defined primary key else my code fails, Here is my command Scaffold MyScaffolder smArtistDetails -Force Here is the .ps1 script [T4Scaffolding.Scaffolder(Description =...
Moon
1

votes
3

answer
2k

Views

packages not loading well

I installed the MvcMailer package in my project. So I was trying to do the scaffolding but it did not work. I googled on this. I got advices that I should install T4Scaffolding and MvcScaffolding Which I did and restarted my visual studio. but unfortunately when start my project from vs some package...
user3302974
1

votes
1

answer
2.7k

Views

'Must specify an object' on piping variable to Get-Member

How come I can successfully pipe result of a cmdlet to Get-Member, but not through a variable? PM> Get-ProjectFolder 'Services' -Project 'Foobar' | Get-Member TypeName: System.__ComObject#{8e2f1269-185e-43c7-8899-950ad2769ccf} Name MemberType Definition...
18

votes
2

answer
1.4k

Views

ASP.NET MVCScaffolding is very slow

We try to use ASP.NET MVC Scaffolding ( http://blog.stevensanderson.com/2011/01/13/scaffold-your-aspnet-mvc-3-project-with-the-mvcscaffolding-package , http://mvcscaffolding.codeplex.com/). Great tool, but please any advise why is it so slow? The scaffolding of simple model in empty project (as desc...
Glebby
12

votes
1

answer
10.2k

Views

ASP.NET MVC 5 Custom Scaffolding Option [t4 templates]

Currently , I am developing a framework , I want to add custom scaffolding option in visual studio menu. By default 'MVC5 Controller with views, using Entity Framework' option 3 from the dialog box chooses 'CodeTemplates\MvcControllerWithContext\Controller.cs.t4' , that t4 again targets view t4 temp...
Md. Alim Ul Karim
2

votes
1

answer
525

Views

how customizing scaffolding template and change .cs.t4 file in MVC

in MVC when we need a form like below that create a new item of my model, we add a strongly type view on the model with create scaffold template, model: public class book { [Key] public int BId { get; set; } [Display(Name = 'نام')] public string name { get; set; } [Display(Name = 'نویسنده'...
mina a.beigi
2

votes
1

answer
1.1k

Views

How Can I get the model properties using T4 template

I am using T4Scaffolding, and tried to create a custom Scaffold template. It's not asp.net project, not MVC. My user class : public class User { public int Id {get;set;} public string Name {get; set;} } in the .cs.t4 file , I need to get the user properties ,I tried to use: var propertyInfos = typeo...
nicholapei
2

votes
2

answer
1.1k

Views

How can I use T4 Custom Scaffolding over projects?

I'm using T4Scaffolding to do some do some C# code generation. Consider the following project structure: I've created a custrom scaffolder in the Templates project. Now I would like to run it for the Dummy project, but I get this exception: How can I use Custom Scaffolding over projects? The thing i...
Kees C. Bakker
2

votes
1

answer
470

Views

MVC3/T4 Custom Scaffolder Gives File Exists Error Even When File Doesn't Exist

I have written a custom scaffolder for MVC3 using T4 templates to scaffold a delete stored procedure for a database and table passed to the scaffolder as parameters. When I run the scaffolder the output file is created in the correct place, but I get the following error: Invoke-ScaffoldTemplate : Un...
nikeaa
2

votes
1

answer
481

Views

Can Visual Studio nuget package manager exclude pre-release packages?

I'm using a package for generating email from Razor views caller MvcMailer. This package depends on T4Scaffolding (>= 1.0.7). T4Scaffolding in turn depends on EntityFramework (>= 4.1.10311.0). This shouldn't be a problem because I have Entity Framework 5.0.0 nuget in my project. For some reason, Ent...
GC.
3

votes
2

answer
1k

Views

Error while installing Mvc Scaffolding package using Package Manager Consoler in VS2012

I am new for using Package Manager Console. I need to install Autofac.Mvc3 and MvcScaffolding packages. I tried to install using Package Manager Console by running the below commands. PM> Install-Package Autofac.Mvc3 But I got the below error. Attempting to resolve dependency 'Autofac (≥ 2.6.3.86...
RGR
3

votes
1

answer
2.2k

Views

Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE when debugging T4Scaffolding.Core Nuget package - Advanced Powershell debugging

I am trying to debug T4Scaffolding.Core Nuget package from outside Visual Studio 2012. I am using Powershell ISE with Powershell 3.0 installed and run under CLRVersion 4.0.30319. I first import several Nuget related items: - Profile.ps1 - nuget.psm1 - NuGet.Cmdlets.dll I am also setting the current...
Rad
2

votes
1

answer
113

Views

Iterating over [ComplexType] properties in T4 scaffolding?

I am customizing the Entity Framework ASP.NET CRUD templates used for Add=>New Scaffolded Item...=>' MVC 5 Controller with views, using Entity Framework'. I am also using the [ComplexType] attribute with classes that are used for entity properties (for example, a [ComplexType] FullName class is use...
Richard Edwards
2

votes
1

answer
2.3k

Views

ASP.NET mvc scaffolding with existing repository and mapping POCO to viewmodels

I have an asp.net mvc solution with three projects UI ASP.NET MVC POCO My Domain POCO objects Repository using entity framework and t4 to generate context and POCO classes I want my UI project to use ViewModels not the POCO classes. I need to do scaffolding for UI and For Repository...
riadh gomri
7

votes
1

answer
218

Views

Fails to Scaffolding on project which has a reference to edmx

I have Demo solution with two projects like this : I have installed T4Scaffolding.Install-Package T4Scaffolding I have added a reference of AdventureWorksModel to my RepoLayer Project and install EF6 . Now when i try to run the following command : scaffold repository AdventureWorksModel.Customer to...
Anyname Donotcare
2

votes
1

answer
1.6k

Views

Right click 'Properties' on VS2012 solution displays: “Object not set to instance of an object” error

Started receiving the 'Object reference not set to instance of an object' error when trying to view the properties dialog for a solution in VS2012 after upgrading from NServiceBus v3 to v4. The problem looks like it's the same as raised in this post, so sorry for any duplication. This post was rais...
stush
4

votes
1

answer
705

Views

Add new Custom T4 template in Add New Controller Dialog under Scaffold options

I want to implement new T4 templates which should appear under Scaffold options in Add New Controller Dialog. I have tried adding a new View tt template.I was able to add it. I need a reference where I can get basic information on how to create a new Controller template rather than modifying existi...
Patil
2

votes
0

answer
348

Views

VS 2015 Community - Custom Scaffold - MVC 4 - Custom type

I'm trying to use custom scaffolding on Visual Studio 2015 Community with MVC 4. My model has a custom type, a class created by me. Sample: public class Teste { public DateTime data { get; set; } public string texto { get; set; } [DataType(DataType.Text)] public DateRange dateRange { get; set; } } a...
Tito
2

votes
0

answer
23

Views

Prevent scaffolding of certain views in ASP.NET MVC

I have customized the controller and a couple of views using T4 in MVC and no longer need the Details and Delete views. How do I prevent Visual Studio from scaffolding these views out when I scaffold out the controller and other views? Thanks!
Jason Presley
15

votes
5

answer
7.4k

Views

Scaffolding controllers with repositories in Mvc5, EF6, VisualStudio 2013

In vs2012 I used to use Steve Sanderson's mvcScaffolding Package with this package I could scaffold Action Methods with unit tests and controllers with repositories and dependency injection. My question is simple. Is there a way to do so in vs2013? When I install the package in vs2013 I get the foll...
Maximo Dominguez
4

votes
1

answer
2.2k

Views

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 PowerShell logic can use Visual Studio’s “code model...
Samy