[{"data":1,"prerenderedAt":522},["ShallowReactive",2],{"blog:2009:linq-to-sql-templates-updated-now-on-codeplex":3,"blogMore-Development":161,"comments-linq-to-sql-templates-updated-now-on-codeplex":174},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"category":11,"tags":12,"excerpt":16,"body":31,"_type":151,"_id":152,"_source":153,"_file":154,"_stem":155,"_extension":156,"url":157,"wordCount":158,"minutes":159,"commentCount":160},"/blog/2009/linq-to-sql-templates-updated-now-on-codeplex","2009",false,"en","LINQ to SQL templates updated, now on CodePlex","My templates that allow you to customize the LINQ to SQL code-generation process (normally performed by SQLMetal/LINQ to SQL classes designer) have been updated once again.","2009-01-19T17:48:27+00:00","Development",[13,14,15],".NET","LINQ","T4",{"type":17,"children":18},"root",[19,27],{"type":20,"tag":21,"props":22,"children":23},"element","p",{},[24],{"type":25,"value":26},"text","This post is over 10 years old. These templates are no longer maintained and the information may be outdated.",{"type":20,"tag":21,"props":28,"children":29},{},[30],{"type":25,"value":9},{"type":17,"children":32,"toc":145},[33,41,45,52,115,121,126,131,136],{"type":20,"tag":34,"props":35,"children":36},"warning",{},[37],{"type":20,"tag":21,"props":38,"children":39},{},[40],{"type":25,"value":26},{"type":20,"tag":21,"props":42,"children":43},{},[44],{"type":25,"value":9},{"type":20,"tag":46,"props":47,"children":49},"h2",{"id":48},"updates",[50],{"type":25,"value":51},"Updates",{"type":20,"tag":53,"props":54,"children":55},"ul",{},[56,80,94,105,110],{"type":20,"tag":57,"props":58,"children":59},"li",{},[60,62,71,73],{"type":25,"value":61},"Now licensed under the ",{"type":20,"tag":63,"props":64,"children":68},"a",{"href":65,"rel":66},"https://www.codeplex.com/l2st4/license",[67],"nofollow",[69],{"type":25,"value":70},"Microsoft Public License",{"type":25,"value":72}," and ",{"type":20,"tag":63,"props":74,"children":77},{"href":75,"rel":76},"https://github.com/damieng/l2st4",[67],[78],{"type":25,"value":79},"hosted at CodePlex",{"type":20,"tag":57,"props":81,"children":82},{},[83,85,92],{"type":25,"value":84},"User options specified with a ",{"type":20,"tag":86,"props":87,"children":89},"code",{"className":88},[],[90],{"type":25,"value":91},"var options",{"type":25,"value":93}," block at the start of the template",{"type":20,"tag":57,"props":95,"children":96},{},[97,99],{"type":25,"value":98},"Option for each class to be a separate file that is reflected in the VS project ",{"type":20,"tag":86,"props":100,"children":102},{"className":101},[],[103],{"type":25,"value":104},"EntityPerFile=true",{"type":20,"tag":57,"props":106,"children":107},{},[108],{"type":25,"value":109},"Detection and support of IsComposable functions",{"type":20,"tag":57,"props":111,"children":112},{},[113],{"type":25,"value":114},"General code clean-up and better error handling such as missing DBML file",{"type":20,"tag":46,"props":116,"children":118},{"id":117},"codeplex",[119],{"type":25,"value":120},"CodePlex",{"type":20,"tag":21,"props":122,"children":123},{},[124],{"type":25,"value":125},"CodePlex makes it easier for people to be able to see and merge updates in with their own modified versions as well as report issues via the issue tracker etc. There is also an RSS feed that lets you keep track of releases, source updates or whatever else you are interested in.",{"type":20,"tag":21,"props":127,"children":128},{},[129],{"type":25,"value":130},"For now it is a grab-the-source style release but I hope to publish downloadable tested releases wrapped up in a Visual Studio Installer (VSI) package to make getting started easier soon.  Feel free to grab the sources directly via TFS/Subversion to be able to diff them with your own modified versions.",{"type":20,"tag":21,"props":132,"children":133},{},[134],{"type":25,"value":135},"Enjoy!",{"type":20,"tag":21,"props":137,"children":138},{},[139],{"type":20,"tag":140,"props":141,"children":142},"em",{},[143],{"type":25,"value":144},"[)amien",{"title":146,"searchDepth":147,"depth":147,"links":148},"",2,[149,150],{"id":48,"depth":147,"text":51},{"id":117,"depth":147,"text":120},"markdown","content:blog:2009:linq-to-sql-templates-updated-now-on-codeplex.md","content","blog/2009/linq-to-sql-templates-updated-now-on-codeplex.md","blog/2009/linq-to-sql-templates-updated-now-on-codeplex","md","/blog/2009/linq-to-sql-templates-updated-now-on-codeplex/",212,1,12,[162,166,170],{"title":163,"date":164,"url":165},"HTML5 Video Cheatsheet: Optimizing videos for the web","2025-12-05T00:00:00Z","/blog/2025/html5-video-cheatsheet/",{"title":167,"date":168,"url":169},"Transactions in the MongoDB EF Core Provider","2025-10-25","/blog/2025/mongodb-explicit-transactions/",{"title":171,"date":172,"url":173},"Queryable Encryption with the MongoDB EF Core Provider","2025-09-22","/blog/2025/mongodb-queryable-encryption/",[175,206,236,257,296,321,352,382,402,446,463,502],{"_path":176,"_dir":177,"_draft":6,"_partial":6,"_locale":7,"title":178,"description":179,"id":180,"name":181,"email":182,"avatar":183,"date":184,"body":185,"_type":151,"_id":203,"_source":153,"_file":204,"_stem":205,"_extension":156},"/comments/linq-to-sql-templates-updated-now-on-codeplex/36555","linq-to-sql-templates-updated-now-on-codeplex","36555","Hi,",36555,"KLCA","carlosnporras@yahoo.com","https://www.gravatar.com/avatar/d353e509b910e28c50fad94d70b5096f?r=pg&d=retro","2010-02-19T09:32:57",{"type":17,"children":186,"toc":201},[187,191,196],{"type":20,"tag":21,"props":188,"children":189},{},[190],{"type":25,"value":179},{"type":20,"tag":21,"props":192,"children":193},{},[194],{"type":25,"value":195},"Excuse me sir ... where is the .wmv file? I'm trying to build an MetaData file automatically having as a start point my .dbml LINQ to SQL DataContext File.",{"type":20,"tag":21,"props":197,"children":198},{},[199],{"type":25,"value":200},"Carlos Porras (El Salvador)",{"title":146,"searchDepth":147,"depth":147,"links":202},[],"content:comments:linq-to-sql-templates-updated-now-on-codeplex:36555.md","comments/linq-to-sql-templates-updated-now-on-codeplex/36555.md","comments/linq-to-sql-templates-updated-now-on-codeplex/36555",{"_path":207,"_dir":177,"_draft":6,"_partial":6,"_locale":7,"title":208,"description":209,"id":210,"name":211,"email":212,"avatar":213,"date":214,"body":215,"_type":151,"_id":233,"_source":153,"_file":234,"_stem":235,"_extension":156},"/comments/linq-to-sql-templates-updated-now-on-codeplex/33019","33019","Hi Damien,",33019,"Harro Schmidt","h.schmidt@tfe.nl","https://www.gravatar.com/avatar/0a530cdb4c9ce2c79587c6c9c239d420?r=pg&d=retro","2009-12-23T00:52:09",{"type":17,"children":216,"toc":231},[217,221,226],{"type":20,"tag":21,"props":218,"children":219},{},[220],{"type":25,"value":209},{"type":20,"tag":21,"props":222,"children":223},{},[224],{"type":25,"value":225},"When using the built-in generator the namespace of my DataContext is MyCompany.Database (the .dbml is located in the folder 'Database' within the project).\nBut with using the template, the namespace 'Database' is missing.\nAny ideas?",{"type":20,"tag":21,"props":227,"children":228},{},[229],{"type":25,"value":230},"Harro",{"title":146,"searchDepth":147,"depth":147,"links":232},[],"content:comments:linq-to-sql-templates-updated-now-on-codeplex:33019.md","comments/linq-to-sql-templates-updated-now-on-codeplex/33019.md","comments/linq-to-sql-templates-updated-now-on-codeplex/33019",{"_path":237,"_dir":177,"_draft":6,"_partial":6,"_locale":7,"title":238,"description":239,"id":240,"name":241,"email":242,"avatar":243,"url":244,"date":245,"body":246,"_type":151,"_id":254,"_source":153,"_file":255,"_stem":256,"_extension":156},"/comments/linq-to-sql-templates-updated-now-on-codeplex/29930","29930","@Daniel : This is normally caused by a DBML coming from another project. The DBML tends to reference the connection via the app.config but the app.config wasn't copied. Opening the DBML in the designer will detect this and remove the offending code so you can setup a new connection.",29930,"Damien Guard","damien@envytech.co.uk","https://www.gravatar.com/avatar/dc72963e7279d34c85ed4c0b731ce5a9?r=pg&d=retro","https://damieng.com/","2009-11-11T11:39:58",{"type":17,"children":247,"toc":252},[248],{"type":20,"tag":21,"props":249,"children":250},{},[251],{"type":25,"value":239},{"title":146,"searchDepth":147,"depth":147,"links":253},[],"content:comments:linq-to-sql-templates-updated-now-on-codeplex:29930.md","comments/linq-to-sql-templates-updated-now-on-codeplex/29930.md","comments/linq-to-sql-templates-updated-now-on-codeplex/29930",{"_path":258,"_dir":177,"_draft":6,"_partial":6,"_locale":7,"title":259,"description":260,"id":261,"name":262,"email":263,"avatar":264,"date":265,"body":266,"_type":151,"_id":293,"_source":153,"_file":294,"_stem":295,"_extension":156},"/comments/linq-to-sql-templates-updated-now-on-codeplex/29928","29928","Great tool! It's really nice to be able to customize the L2S code like that. I used it to fix a circular reference problem LINQ was having when serializing a parent entity to JSON (by adding ScriptIgnore above any Associations).",29928,"Daniel Cotter","cotter.daniel@gmail.com","https://www.gravatar.com/avatar/034a83e2e27fe8f09c57646cce127816?r=pg&d=retro","2009-11-11T11:33:11",{"type":17,"children":267,"toc":291},[268,281,286],{"type":20,"tag":21,"props":269,"children":270},{},[271,273,279],{"type":25,"value":272},"Great tool! It's really nice to be able to customize the L2S code like that. I used it to fix a circular reference problem LINQ was having when serializing a parent entity to JSON (by adding ",{"type":20,"tag":274,"props":275,"children":276},"span",{},[277],{"type":25,"value":278},"ScriptIgnore",{"type":25,"value":280}," above any Associations).",{"type":20,"tag":21,"props":282,"children":283},{},[284],{"type":25,"value":285},"On another note, the line base(global::.Default., mappingSource) was causing a build error for me (couldn't find Default). Is this just because I'm using VS2010b2?",{"type":20,"tag":21,"props":287,"children":288},{},[289],{"type":25,"value":290},"Daniel",{"title":146,"searchDepth":147,"depth":147,"links":292},[],"content:comments:linq-to-sql-templates-updated-now-on-codeplex:29928.md","comments/linq-to-sql-templates-updated-now-on-codeplex/29928.md","comments/linq-to-sql-templates-updated-now-on-codeplex/29928",{"_path":297,"_dir":177,"_draft":6,"_partial":6,"_locale":7,"title":298,"description":299,"id":300,"name":301,"email":302,"avatar":303,"date":304,"body":305,"_type":151,"_id":318,"_source":153,"_file":319,"_stem":320,"_extension":156},"/comments/linq-to-sql-templates-updated-now-on-codeplex/29793","29793","Hi,\nwhat if I have columns like 'private' and 'operator' in my database table. Compiling the code generated with this template fails, obviously. I can't (or lets say don't want to) make any changes to my tables... Any ideas?",29793,"Pavel Kubik","pavel.kubik@gmail.com","https://www.gravatar.com/avatar/ab5848a889c75b10205919a5b6854cbc?r=pg&d=retro","2009-11-10T06:20:08",{"type":17,"children":306,"toc":316},[307,311],{"type":20,"tag":21,"props":308,"children":309},{},[310],{"type":25,"value":299},{"type":20,"tag":21,"props":312,"children":313},{},[314],{"type":25,"value":315},"Thanks, Pavel.",{"title":146,"searchDepth":147,"depth":147,"links":317},[],"content:comments:linq-to-sql-templates-updated-now-on-codeplex:29793.md","comments/linq-to-sql-templates-updated-now-on-codeplex/29793.md","comments/linq-to-sql-templates-updated-now-on-codeplex/29793",{"_path":322,"_dir":177,"_draft":6,"_partial":6,"_locale":7,"title":323,"description":324,"id":325,"name":241,"email":242,"avatar":243,"url":244,"date":326,"body":327,"_type":151,"_id":349,"_source":153,"_file":350,"_stem":351,"_extension":156},"/comments/linq-to-sql-templates-updated-now-on-codeplex/29151","29151","@Nigel: The warnings I see are:",29151,"2009-11-03T15:03:00",{"type":17,"children":328,"toc":347},[329,333],{"type":20,"tag":21,"props":330,"children":331},{},[332],{"type":25,"value":324},{"type":20,"tag":334,"props":335,"children":336},"ol",{},[337,342],{"type":20,"tag":57,"props":338,"children":339},{},[340],{"type":25,"value":341},"Naming - casing/underscores/discrete (change the names in the DBML)",{"type":20,"tag":57,"props":343,"children":344},{},[345],{"type":25,"value":346},"Usage - Settable collection properties (would be a breaking change but you could suppress this warning by modifying the template)",{"title":146,"searchDepth":147,"depth":147,"links":348},[],"content:comments:linq-to-sql-templates-updated-now-on-codeplex:29151.md","comments/linq-to-sql-templates-updated-now-on-codeplex/29151.md","comments/linq-to-sql-templates-updated-now-on-codeplex/29151",{"_path":353,"_dir":177,"_draft":6,"_partial":6,"_locale":7,"title":354,"description":355,"id":356,"name":357,"email":358,"avatar":359,"date":360,"body":361,"_type":151,"_id":379,"_source":153,"_file":380,"_stem":381,"_extension":156},"/comments/linq-to-sql-templates-updated-now-on-codeplex/29115","29115","Love the reorganised code but not so taken by the CA warnings I get from the code that gets generated.",29115,"Nigel Deakin","nigel@dsel.co.uk","https://www.gravatar.com/avatar/9e0500b4439c2420ab17b91e376facee?r=pg&d=retro","2009-11-03T06:25:35",{"type":17,"children":362,"toc":377},[363,367,372],{"type":20,"tag":21,"props":364,"children":365},{},[366],{"type":25,"value":355},{"type":20,"tag":21,"props":368,"children":369},{},[370],{"type":25,"value":371},"How do I surpress any code warnings from the generated code. The project is marked to ignore such but both standard VS2008 and running with this template causes CA to shout out warnings.",{"type":20,"tag":21,"props":373,"children":374},{},[375],{"type":25,"value":376},"Regards, Nigel",{"title":146,"searchDepth":147,"depth":147,"links":378},[],"content:comments:linq-to-sql-templates-updated-now-on-codeplex:29115.md","comments/linq-to-sql-templates-updated-now-on-codeplex/29115.md","comments/linq-to-sql-templates-updated-now-on-codeplex/29115",{"_path":383,"_dir":177,"_draft":6,"_partial":6,"_locale":7,"title":384,"description":385,"id":386,"name":387,"email":388,"avatar":389,"date":390,"body":391,"_type":151,"_id":399,"_source":153,"_file":400,"_stem":401,"_extension":156},"/comments/linq-to-sql-templates-updated-now-on-codeplex/27514","27514","This is a fantastic piece of plumbing and will save my team a lot of work, specifically in the realm of serialization.  I really appreciate your efforts, Damien.  I really hope DataContract serialization support is native in the next version of Visual Studio LINQ to SQL.",27514,"Jordan Rieger","jordanrieger@gmail.com","https://www.gravatar.com/avatar/9e6afc790b107562a54a9e6ec55bd481?r=pg&d=retro","2009-10-06T16:43:56",{"type":17,"children":392,"toc":397},[393],{"type":20,"tag":21,"props":394,"children":395},{},[396],{"type":25,"value":385},{"title":146,"searchDepth":147,"depth":147,"links":398},[],"content:comments:linq-to-sql-templates-updated-now-on-codeplex:27514.md","comments/linq-to-sql-templates-updated-now-on-codeplex/27514.md","comments/linq-to-sql-templates-updated-now-on-codeplex/27514",{"_path":403,"_dir":177,"_draft":6,"_partial":6,"_locale":7,"title":404,"description":405,"id":406,"name":407,"email":408,"avatar":409,"date":410,"body":411,"_type":151,"_id":443,"_source":153,"_file":444,"_stem":445,"_extension":156},"/comments/linq-to-sql-templates-updated-now-on-codeplex/20463","20463","When I try it I get...",20463,"Ken_S.","x@x.com","https://www.gravatar.com/avatar/85e4239ff9662bf8296083d98da17677?r=pg&d=retro","2009-07-08T07:38:02",{"type":17,"children":412,"toc":441},[413,417,426,431,436],{"type":20,"tag":21,"props":414,"children":415},{},[416],{"type":25,"value":405},{"type":20,"tag":418,"props":419,"children":421},"pre",{"code":420},"System.Runtime.Serialization.InvalidDataContractException: Type 'System.Runtime.Serialization.DataContractSerializer' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. See the Microsoft .NET Framework documentation for other supported types.\nat VOC3_Web_Services.VOC3_Web_Services.getTitle(String _user, String _criterion) in C:\\\\Download\\\\C#_Projects\\\\VOC3_Web_Services\\\\VOC3_Web_Services\\\\VOC3_Web_Services.asmx.cs:line 123\n",[422],{"type":20,"tag":86,"props":423,"children":424},{"__ignoreMap":146},[425],{"type":25,"value":420},{"type":20,"tag":21,"props":427,"children":428},{},[429],{"type":25,"value":430},"Also, how do I remove it? I took out the \"L2ST4.ttinclude\" \"VOC3_DB.tt\" files but now get the following Warning...",{"type":20,"tag":21,"props":432,"children":433},{},[434],{"type":25,"value":435},"The custom tool 'MSLinqToSQLGenerator' failed while processing the file 'Data_Layer\\VOC3_DB.dbml'.",{"type":20,"tag":21,"props":437,"children":438},{},[439],{"type":25,"value":440},"Thank you.",{"title":146,"searchDepth":147,"depth":147,"links":442},[],"content:comments:linq-to-sql-templates-updated-now-on-codeplex:20463.md","comments/linq-to-sql-templates-updated-now-on-codeplex/20463.md","comments/linq-to-sql-templates-updated-now-on-codeplex/20463",{"_path":447,"_dir":177,"_draft":6,"_partial":6,"_locale":7,"title":448,"description":449,"id":450,"name":241,"email":242,"avatar":243,"url":244,"date":451,"body":452,"_type":151,"_id":460,"_source":153,"_file":461,"_stem":462,"_extension":156},"/comments/linq-to-sql-templates-updated-now-on-codeplex/19474","19474","@Melle you'll need to install either the Clarius or the Tangible T4 editors as there is no syntax highlighting in-the-box.",19474,"2009-06-19T07:41:54",{"type":17,"children":453,"toc":458},[454],{"type":20,"tag":21,"props":455,"children":456},{},[457],{"type":25,"value":449},{"title":146,"searchDepth":147,"depth":147,"links":459},[],"content:comments:linq-to-sql-templates-updated-now-on-codeplex:19474.md","comments/linq-to-sql-templates-updated-now-on-codeplex/19474.md","comments/linq-to-sql-templates-updated-now-on-codeplex/19474",{"_path":464,"_dir":177,"_draft":6,"_partial":6,"_locale":7,"title":465,"description":466,"id":467,"name":468,"email":469,"avatar":470,"date":471,"body":472,"_type":151,"_id":499,"_source":153,"_file":500,"_stem":501,"_extension":156},"/comments/linq-to-sql-templates-updated-now-on-codeplex/19468","19468","Brilliant!",19468,"Melle","melle@fastmail.fm","https://www.gravatar.com/avatar/2cbfcfe8cdd4448171c20738ffd51c5a?r=pg&d=retro","2009-06-19T06:02:18",{"type":17,"children":473,"toc":497},[474,478,483,488,493],{"type":20,"tag":21,"props":475,"children":476},{},[477],{"type":25,"value":466},{"type":20,"tag":21,"props":479,"children":480},{},[481],{"type":25,"value":482},"I will make it to work on separate assemblies. One for the entities and one for the data access.\nThis looks really great. Thanks for the effort!!",{"type":20,"tag":21,"props":484,"children":485},{},[486],{"type":25,"value":487},"How do you get the syntaxt highlighting on the .TT source (without VS complaining about whitespace and identifiers - I set it as a C# file)?",{"type":20,"tag":21,"props":489,"children":490},{},[491],{"type":25,"value":492},"Regards,",{"type":20,"tag":21,"props":494,"children":495},{},[496],{"type":25,"value":468},{"title":146,"searchDepth":147,"depth":147,"links":498},[],"content:comments:linq-to-sql-templates-updated-now-on-codeplex:19468.md","comments/linq-to-sql-templates-updated-now-on-codeplex/19468.md","comments/linq-to-sql-templates-updated-now-on-codeplex/19468",{"_path":503,"_dir":177,"_draft":6,"_partial":6,"_locale":7,"title":504,"description":505,"id":506,"name":507,"email":508,"avatar":509,"date":510,"body":511,"_type":151,"_id":519,"_source":153,"_file":520,"_stem":521,"_extension":156},"/comments/linq-to-sql-templates-updated-now-on-codeplex/10941","10941","viewing plug-in with moonlight for linux. works well.",10941,"matt","ingrouille@gmail.com","https://www.gravatar.com/avatar/5bdc30e8cd38479c50f1950a719a8cc4?r=pg&d=retro","2009-01-25T23:53:26",{"type":17,"children":512,"toc":517},[513],{"type":20,"tag":21,"props":514,"children":515},{},[516],{"type":25,"value":505},{"title":146,"searchDepth":147,"depth":147,"links":518},[],"content:comments:linq-to-sql-templates-updated-now-on-codeplex:10941.md","comments/linq-to-sql-templates-updated-now-on-codeplex/10941.md","comments/linq-to-sql-templates-updated-now-on-codeplex/10941",1779264585931]