We've got a few patches that we would like to see go in to the NetTiers source.
Here's a simple one to make sure that I've got the procedure right:
Scenario
======
We are using the Service tier, and some of our custom methods pass "where clauses" down to the GetPaged method. Using the sample PetStore application as an example, our
petshopDB.Service.AccountService.CustomMethod()
calls
petshopDB.Service.AccountServiceBase.GetPaged(string whereClause, string orderBy, int start, int pageLength, out int totalCount)
Problem
======
If we change our Account database table, by changing the name of a column, the whereClause is no longer valid. We have to search through our code for any text references to the changed column.
Solution
======
We would like tags in the Service objects that we can use to refer to the database columns used in our whereClause. For instance:
public partial class AccountServiceBase : ServiceBase<Account, AccountKey>
{
#region Tag Declarations
/// <summary>
/// A tag to use in database queries regarding the Id column
/// </summary>
public const System.String Id_TAG = "Id";
/// <summary>
/// A tag to use in database queries regarding the FirstName column
/// </summary>
public const System.String FirstName_TAG = "FirstName";
....
We can use these in our whereClause:
String where = FirstName_TAG + "=Brian";
GetPaged(where, "", 0, 10, out totalCount) ;
Then when the database column is renamed, the invalid whereClause will generate a compile error.
I have attached a patch file against revision 686 of svn. The file adds the tags to ComponentViewServiceBase and ComponentServiceBase.