<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx</link><description>To get the latest build of T4MVC: Go to T4MVC home page This post is a continuation of various recent posts, most notably: A new and improved ASP.NET MVC T4 template The MVC T4 template is now up on CodePlex First, I’d like to thank all those who are</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9810175</link><pubDate>Wed, 01 Jul 2009 03:06:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9810175</guid><dc:creator>eric hexter</dc:creator><description>&lt;p&gt;The protected constructor is a very interesting approach. &amp;nbsp;Now I have to pull it down and do some testing around my container of choice.. StructureMap&lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9810423</link><pubDate>Wed, 01 Jul 2009 09:43:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9810423</guid><dc:creator>Christian</dc:creator><description>&lt;p&gt;hi david,&lt;/p&gt;
&lt;p&gt;the protected constructor fixed the problem for me. (I'm using StructureMap) THANK YOU!&lt;/p&gt;
&lt;p&gt;but why do even create this constructor with your dummy-parameter? my workaround yesterday was to just remove this one and make sure that there's always a default constructor. (I think this is done by your template anyway)&lt;/p&gt;
&lt;p&gt;StructureMap for example always calls the constructor with most parameters, so this already fixes the problem.&lt;/p&gt;
&lt;p&gt;thanks for working on this,&lt;/p&gt;
&lt;p&gt;christian&lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9810450</link><pubDate>Wed, 01 Jul 2009 10:09:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9810450</guid><dc:creator>Christian</dc:creator><description>&lt;p&gt;the ExecuteResult()-method of your ControllerActionCallInfo class should not throw a &amp;quot;NotImplementedException&amp;quot; because ReSharper for example shows this as an open entry in the TODO-list. I think it would be better if you throw a &amp;quot;NotSupportedException&amp;quot;.&lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9810814</link><pubDate>Wed, 01 Jul 2009 14:30:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9810814</guid><dc:creator>Richard Kimber</dc:creator><description>&lt;p&gt;This is a really useful template, it has become an integral part of my current project. Thanks for sharing.&lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9810891</link><pubDate>Wed, 01 Jul 2009 15:21:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9810891</guid><dc:creator>Anthony</dc:creator><description>&lt;p&gt;Love the new strongly typed support for MapRoute... &lt;/p&gt;
&lt;p&gt;My only concern is that when one uses &amp;quot;MVC.Home.Index()&amp;quot; what this does is not 100% clear to a ready who doesn't know about the templates or how they work. As in when a user sees &amp;quot;MVC.SomthingOrOther&amp;quot;, the MVC doesn't mean much to me. &lt;/p&gt;
&lt;p&gt;What this template is all about and the fluid interface it generates is strongly typed names/references. So couldn't we come up with something a little more suggestive than just &amp;quot;MVC&amp;quot; that helps the user out a little more like &amp;quot;RouteFor.SomthingOrOther&amp;quot;??? &lt;/p&gt;
&lt;p&gt;Now in reality it doest have to be &amp;quot; RouteFor &amp;quot;, but if someone saw RouteFor.Home.Index() vs. MVC.Home.Index() it might be a little more clear about what the intending usage is in a given scenario. &lt;/p&gt;
&lt;p&gt;I just think there must be a better name than just MVC that helps describe to the user whats going on.&lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9811507</link><pubDate>Wed, 01 Jul 2009 20:32:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9811507</guid><dc:creator>Hien Khieu</dc:creator><description>&lt;p&gt;David,&lt;/p&gt;
&lt;p&gt;I am trying to use your latest T4MVC template with my mvc project and I get this error. Please help.&lt;/p&gt;
&lt;p&gt;Error 1 Running transformation: System.EntryPointNotFoundException: Entry point was not found.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;at VisualSVN.VS.Interop.NativeExtenderCallback.OnQueryEditFiles(UInt32 rgfQueryEdit, String[] rgpszMkDocuments, UInt32* pfEditVerdict, UInt32* prgfMoreInfo, Boolean* skipOriginal)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;at VisualSVN.VS.Interop.NativeExtender.OnQueryEditFiles(NativeExtender* , UInt32 rgfQueryEdit, Int32 cFiles, UInt16** rgpszMkDocuments, UInt32* rgrgf, __MIDL___MIDL_itf_ivsqueryeditquerysave2_0000_0001* rgFileInfo, UInt32* pfEditVerdict, UInt32* prgfMoreInfo, Boolean* skipOriginal)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;at EnvDTE80.CodeClass2.set_ClassKind(vsCMClassKind Kind)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;at Microsoft.VisualStudio.TextTemplating984425EEA278851503849A871981DA21.GeneratedTextTransformation.ProcessControllerTypesInNamespace(CodeNamespace ns) in e:\Development\CSharp\MVC\MVCExperiment\MVCExperiment\Mvc-CodeGen.tt:line 401&lt;/p&gt;
&lt;p&gt; &amp;nbsp;at Microsoft.VisualStudio.TextTemplating984425EEA278851503849A871981DA21.GeneratedTextTransformation.ProcessControllersRecursive(ProjectItem projectItem) in e:\Development\CSharp\MVC\MVCExperiment\MVCExperiment\Mvc-CodeGen.tt:line 381&lt;/p&gt;
&lt;p&gt; &amp;nbsp;at Microsoft.VisualStudio.TextTemplating984425EEA278851503849A871981DA21.GeneratedTextTransformation.ProcessControllersRecursive(ProjectItem projectItem) in e:\Development\CSharp\MVC\MVCExperiment\MVCExperiment\Mvc-CodeGen.tt:line 374&lt;/p&gt;
&lt;p&gt; &amp;nbsp;at Microsoft.VisualStudio.TextTemplating984425EEA278851503849A871981DA21.GeneratedTextTransformation.ProcessControllersFolder(Project project) in e:\Development\CSharp\MVC\MVCExperiment\MVCExperiment\Mvc-CodeGen.tt:line 366&lt;/p&gt;
&lt;p&gt; &amp;nbsp;at Microsoft.VisualStudio.TextTemplating984425EEA278851503849A871981DA21.GeneratedTextTransformation.PrepareDataToRender(TextTransformation tt) in e:\Development\CSharp\MVC\MVCExperiment\MVCExperiment\Mvc-CodeGen.tt:line 306&lt;/p&gt;
&lt;p&gt; &amp;nbsp;at Microsoft.VisualStudio.TextTemplating984425EEA278851503849A871981DA21.GeneratedTextTransformation.TransformText() in e:\Development\CSharp\MVC\MVCExperiment\MVCExperiment\Mvc-CodeGen.tt:line 96 E:\Development\CSharp\MVC\MVCExperiment\MVCExperiment\Mvc-CodeGen.tt 1 1 &lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9812025</link><pubDate>Thu, 02 Jul 2009 00:46:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9812025</guid><dc:creator>Anthony</dc:creator><description>&lt;p&gt;Just another quick comment. The Members and Classes that you add to the partial class of each controller (with the exception of RedirectToAction), why wouldn't you you put them into the sub type &amp;quot;T4MVC_xyz&amp;quot; that you generate for a given controller and change the static reference in the MVC class to &amp;quot;public static T4MVC_SquadProfileController = new T4MVC_SquadProfileController();&amp;quot;? &lt;/p&gt;
&lt;p&gt;Just a thought. &lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9812045</link><pubDate>Thu, 02 Jul 2009 00:59:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9812045</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Christian: we need the dummy ctor because if the Controller already has a default ctor, it may have logic we don't want to execute. So I guess technically, we only need the Dummy when there is already an explicit default ctor, so we could optimize that a bit.&lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9812048</link><pubDate>Thu, 02 Jul 2009 01:00:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9812048</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Christian, new build 2.2.01 on CodePlex throws NotSupportedException as you suggest. &amp;nbsp;Thanks!&lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9812057</link><pubDate>Thu, 02 Jul 2009 01:06:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9812057</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Anthony: I agree that the syntax on routes doesn't make it super clear what it's doing. What's tricky is that 'MVC.Home.Index()' is the standard syntax T4MVC to encapsulate an action call with params, so it looks the same here as in ActionLink, RedirectToAction, ...&lt;/p&gt;
&lt;p&gt;Of course, we can change the MVC prefix if we find a better one, but it would be used in those other places as well.&lt;/p&gt;
&lt;p&gt;And finally, we could rename the MapRoute() extension method to something like MapRouteToController() if we think that's better.&lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9812068</link><pubDate>Thu, 02 Jul 2009 01:10:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9812068</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Anthony: I actually started out this way, with new members added in the derived class. &amp;nbsp;However, I found two reasons to do it as I did:&lt;/p&gt;
&lt;p&gt;1. I wanted 'Go To Definition' on MVC.Home.Index() to go to the user's Index method, and not the generated derived method.&lt;/p&gt;
&lt;p&gt;2. Having it on the base lets your shorten MVC.Dinner.Views.InvalidOwner to simply Views.InvalidOwner when writing code in the Dinners controller.&lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9812124</link><pubDate>Thu, 02 Jul 2009 01:24:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9812124</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Hien Khieu: see my reply in the other post.&lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9814037</link><pubDate>Thu, 02 Jul 2009 16:22:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9814037</guid><dc:creator>Richard Kimber</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I made the following changes at line 282 to get the code to compile with FileResult.&lt;/p&gt;
&lt;p&gt;&amp;lt;# foreach (string resultType in ActionResultTypes) { #&amp;gt;&lt;/p&gt;
&lt;p&gt;[CompilerGenerated]&lt;/p&gt;
&lt;p&gt;public class T4MVC_&amp;lt;#= resultType #&amp;gt;: &amp;lt;#= resultType #&amp;gt;, IT4MVCActionResult {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public T4MVC_&amp;lt;#= resultType #&amp;gt;(string controller, string action) &amp;lt;# if (resultType == &amp;quot;FileResult&amp;quot;) { #&amp;gt;: base(&amp;quot;&amp;quot;)&amp;lt;# } #&amp;gt; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.InitMVCT4Result(controller, action);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public override void ExecuteResult(ControllerContext context) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;throw new NotSupportedException();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public string Controller { get; set; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public string Action { get; set; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public RouteValueDictionary RouteValues { get; set; }&lt;/p&gt;
&lt;p&gt;	&amp;lt;# if (resultType == &amp;quot;FileResult&amp;quot;) { #&amp;gt;&lt;/p&gt;
&lt;p&gt;	protected override void WriteFile(HttpResponseBase response) {&lt;/p&gt;
&lt;p&gt;		throw new NotImplementedException();&lt;/p&gt;
&lt;p&gt;	}&lt;/p&gt;
&lt;p&gt;	&amp;lt;# } #&amp;gt;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;lt;# } #&amp;gt;&lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9816419</link><pubDate>Fri, 03 Jul 2009 11:34:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9816419</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Richard: I just fixed this issue in build 2.2.02 on CodePlex. Thanks!&lt;/p&gt;
</description></item><item><title>WebForms</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9827519</link><pubDate>Thu, 09 Jul 2009 22:55:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9827519</guid><dc:creator>Mark Leistner</dc:creator><description>&lt;p&gt;How difficult would it be to add support for ASP.Net WebForms pages as well, similar to how static content files are stored under Links.&lt;/p&gt;
&lt;p&gt;Many projects I work on are slowly migrating to MVC and will contain both WebForms and MVC for the foreseable future. &amp;nbsp;I'd love to be able to reference the files as Pages.Home_aspx instead of &amp;quot;~/Home.aspx&amp;quot;.&lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9829083</link><pubDate>Sat, 11 Jul 2009 00:18:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9829083</guid><dc:creator>Kiran</dc:creator><description>&lt;p&gt;David,&lt;/p&gt;
&lt;p&gt;This doesn't work if the controllers are in a different assembly&lt;/p&gt;
</description></item><item><title>re: T4MVC 2.2 update: Routing, Forms, DI container, fixes</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/30/t4mvc-2-2-update-routing-forms-di-container-fixes.aspx#9829176</link><pubDate>Sat, 11 Jul 2009 02:34:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9829176</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Mark Leistner: that's an interesting idea. &amp;nbsp;I'll put that on the list of future scenarios to look at.&lt;/p&gt;
</description></item></channel></rss>