Notes on Change Set 19586

March 7, 2007 23:17

Download

I've found the CodePlex comments a bit limiting, so I'm now posting and complex Change Set notes externally...

Breaking Changes

The aggregate methods in Query are no longer static. This affects the following methods:
	GetCount()
	GetSum()
	GetAverage()
	GetMax()
	GetMin()
This change is being made as part of the current effort to ensure provider uniformity across SubSonic. By making these instantiated methods, we ensure that the executing provider is known to the method, and the correct syntax is automatically used for the given platform.

Old Syntax
int foo = Convert.ToInt32(Query.GetSum(tableName, columnName));
New Syntax
Query qry = new Query(table);
int foo = Convert.ToInt32(tableName, qry.Sum(columnName));

Bugs

  • Fixed issue with setting DBNull values in SqlDataProvider.AddParams() from ChangeSet 19526

Enhancements

  • Logic improvements to DataService.GetInstance()
  • Simplified logic in DataProvider.Initialize();
  • Added virtual MakeParam() method to DataProvider to simplify construction of provider-specific parameters.

1 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Related posts

Comments

March 26. 2007 07:48

Mischa Kroon

Much better, but still prohibitive Smile

Very good to see the other main aggregrate functions in here.

But the syntax is still well prohibitive and it's even a bit less slick then it was.

A nicer way to do this would be a:

QueryObject.GetSum()

Function which would actually transform the query to a aggregrate query.

Much more powerfull, and not limited to 1 condition.

Mischa Kroon

Comments are closed