CSLA .NET

From Rockford Lhotka's Expert C# 2008 and VB 2008 Business Objects books

LoadProperty overloads: changed between 3.X and 3.6 ?

rated by 0 users
This post has 2 Replies | 2 Followers

Top 50 Contributor
Posts 151
Luc Morin Posted: Sun, Jan 4 2009 10:05 PM
Hi,

I have not done any real work with CSLA 3.X, and just recently started to work with 3.6.

I have read a few posts on this forum suggesting that at some point it was possible to use the following:

LoadProperty<T,S>(var1, var2);

Also, the CodeSmith templates on CSLAContrib generate that kind of code.

Now, moving on to 3.6, this construct doesn't seem to be allowed anymore.

Am I correct about this change ?

Thank you.


Luc Morin, T.P.
http://www.stlm.ca

Top 10 Contributor
Posts 7,309

The Set/Get/Load/ReadProperty() method signatures did change a little bit, so type inference works.

The big change is that the LoadProperty<P,F>() overloads are now renamed to LoadPropertyConvert<P,F>() to eliminate ambiguity.

This means you can do:

LoadProperty(NameProperty, "Fred")

and the compiler will resolve the type parameters for you. But you still need to provide the type parameters for LoadPropertyConvert().

Rocky

Top 50 Contributor
Posts 151
Thanks Rocky,

This is what I get when I work late on a Sunday night...

After posting, I found the change in the changelog for 3.6, but the delay for post deletion had expired Big Smile [:D]

I have modified the CSLAContrib CodeSmith templates to reflect that change.

On a related note, do you happen to know if Rick Supit is still actively working on those templates ? I'd be glad to give him a hand, but I've tried to e-mail him with no success.

Regards.

Luc Morin, T.P.
http://www.stlm.ca

Page 1 of 1 (3 items) | RSS

Please contact Magenic for your .NET consulting
and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems