Breaking CSLA 4.0 property changes when using private backing fields.

I came across this bug last night , which was occurring right as CSLA 4 was released. It had to deal with the CodeSmith CSLA templates when you set UseMemberVariables to true. The error is quite obscure and not very intuitive as the signs of a bug are only found when you check to see if your business object IsValid. The scenario in this case is when you set a required managed property, the rules never fully evaluate the set value. A bunch of other side effects could occur as well. Here is the error you could receive: CategoryId required Expected: True But was: False Here is the code that was causing...

How-to: Upgrade a Community Server website thats running 2.1, 2007 or 2008 site to Community Server 2008 or Telligent Community 5.5

I have done a few of these upgrades for a few big sites like Bink.nu and Sober.com . Here is the safest way without a ton of headaches. Please contact me if you need help, I'm willing to do the upgrade for people as well... Please do SQL backups after every step! Database Instructions Upgrade from Community Server 2.1 to 2007.0 Create a SQL backup. Run SQL Compare against a fresh database of cs2007 to the upgraded database and make sure everything transferred correctly. If there were changes, create a SQL backup. Run the upgrade from 2007.0 to the last service pack release of 2007. (I think...

How-to: Preserve column names in generated PLINQO entities.

There may come a time where you need to rename a column in your generated entity for whatever reason. The following tip and trick article will show you how to quickly accomplish this. Let's assume you have a generated property for the column AccountId and it is defined like this: [System.CodeDom.Compiler.GeneratedCode("CodeSmith", "5.0.0.0")] private int _accountId = default(int); /// /// Gets the AccountId column value. /// [System.Data.Linq.Mapping.Column(Name = "AccountId", Storage = "_accountId", DbType = "int NOT NULL IDENTITY", IsPrimaryKey...

How-to: Upgrade your existing CodeSmith Generator CSLA templates from version 3.8 to 4.0

We recently released a new major version of the CodeSmith Generator CSLA templates that add support for many new features including Visual Studio 2010, CSLA 4.0 and Silverlight 4.0 support. They can be downloaded here . When upgrading to the templates and you are going from CSLA 3.8 to the latest CSLA 3.8.4 templates, there really aren’t any changes you need to make other than updating your CodeSmith Project File template location to point to the new version of the templates. The easiest way to do this is to open up Visual Studio and double click on the CodeSmith Project File and do a replace...

CodeSmith Generator supports Microsoft Visual Studio 2010 RTM!

CodeSmith Generator supports Microsoft Visual Studio 2010 RTM!

We have been working with Microsoft over the past few months to ensure that CodeSmith Generator works with Microsoft Visual Studio 2010 . The currently released version of CodeSmith Generator 5.x already supports Visual Studio 2010 Integration. Although the current support is titled as beta we have ran into very few Visual Studio 2010 bugs and will completely stand behind Visual Studio 2010. Microsoft and Microsoft logo's are trademarks of Microsoft Corporation....

Unit testing the CodeSmith Generator CSLA generated template code

During the development of our CodeSmith Generator CSLA templates we have spent a lot time unit testing the generated code to ensure everything was working correctly. In the future we would like to generate basic CRUD unit tests for any project. We decided to unit test the PetShop database to go along with our PetShop Sample application. We have a solution both in VB and C# that can be found in (Documents\CodeSmith\Samples\v5.3\Projects\Framework-Samples\Csla) when you install CodeSmith Generator or grab the latest version from SVN . We have unit tests for all the Data Access implementations as...

How-to: Upgrade your existing PLINQO or CSLA CodeSmith Generator Templates

This article will help you upgrade your solutions templates safely and easily to the latest major or minor version. The latest templates can be found on our Google code project and the latest nightly build can be found here . The first thing to do is to download the template framework you wish to update. After the templates have been downloaded and extracted. Remove or Replace the old templates with the new ones keeping the same folder structure or simply update your CodeSmith Generator Project File(s) to point to the updated templates. If you have custom made changes, this is where you merge in...

How-to: Use Microsoft SQL Server CLR Functions and Functions in your CodeSmith Generator Templates

In a previous article , I had mentioned that we added support for Microsoft SQL Server CLR Stored procedures and Functions in the release of CodeSmith Generator 5.2 . Since then there has been a few questions since then on how to add this to your existing templates. The great news is, you can add the functionality in a few easy changes. To enable SQL function support you need to set IncludeFunctions="True" on any types inheriting from SchemaObjectBase (E.G. CommandSchema, CommandSchemaCollection, DatabaseSchema...). Once this has been done you will see SQL functions be added to your User...

How-to: Use Microsoft SQL Server Functions in your CodeSmith Generator Templates

CodeSmith Generator now supports Microsoft SQL Server Functions and Microsoft SQL Server CLR Functions with the release of CodeSmith Generator 5.2 . I will quickly show you how to add Microsoft SQL Server Function support to your CodeSmith Generator template. The first thing you need to do in order to use SQL Functions is to set the IncludeFunctions Property on any type that derives from SchemaObjectBase . The following property types are capable of showing functions when you add the IncludeFunctions="True" setting to the property: CommandSchema , CommandSchemaCollection and DatabaseSchema...

How-to: Build a custom UITypeEditor

Recently, I built a CodeSmith Generator sample UITypeEditor that allows a user to enter in custom data into a DropDownList. In the following article I’ll show you what you need to do in order to build your own UITypeEditor. First you need to create a public class that will hold the data of the drop down list. In this example I named my class DropDownListProperty. public class DropDownListProperty { } Next we will need to add the properties and the constructors. public class DropDownListProperty { private List _values = new List (); public DropDownListProperty() { SelectedItem = "None";...