LLBL, VS2005 and partial classes

Posts   
 
    
omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 03-Jun-2005 20:40:47   

greetings, I have been toying with a pilot under VS2005 (beta2). Our current senario is that we are using a framework that is based on the extended adapter template classes: 1- DAL projects generated by LLBL 2- BL classes based on extended adapter templates

all is working fine under VS2005 and .NT2.0. What I really wanted to do is use partial classes so that both tha DAL and BL class compile as one class although physically they are two different files. anyone has tried to do this especially that I am not abig fan of customizing LLBL's templates as that has always proven to be a bad idea.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 05-Jun-2005 10:06:57   

omar wrote:

greetings, I have been toying with a pilot under VS2005 (beta2). Our current senario is that we are using a framework that is based on the extended adapter template classes: 1- DAL projects generated by LLBL 2- BL classes based on extended adapter templates

all is working fine under VS2005 and .NT2.0. What I really wanted to do is use partial classes so that both tha DAL and BL class compile as one class although physically they are two different files. anyone has tried to do this especially that I am not abig fan of customizing LLBL's templates as that has always proven to be a bad idea.

All you've to do is copy the entity class templates, add 'partial' to the class definition (public class <[CurrentEntityName]>Entity becomes public partial class ... ) and you're good to go! simple_smile

Frans Bouma | Lead developer LLBLGen Pro
omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 06-Jun-2005 14:53:01   

All you've to do is copy the entity class templates, add 'partial' to the class definition (public class <[CurrentEntityName]>Entity becomes public partial class ... ) and you're good to go!

that part I got working ok. What I was really asking about is how to handle cases where I was overriding stuff in my BL from the parent DL class. Now they are one class and I was thinking of a good way to do this without modifying LLBL's templates

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 07-Jun-2005 11:02:50   

omar wrote:

All you've to do is copy the entity class templates, add 'partial' to the class definition (public class <[CurrentEntityName]>Entity becomes public partial class ... ) and you're good to go!

that part I got working ok. What I was really asking about is how to handle cases where I was overriding stuff in my BL from the parent DL class. Now they are one class and I was thinking of a good way to do this without modifying LLBL's templates

Hmm. That's still a problem. if you want to override code, you still have to create a derived class. The partial classes are more useful to ADD code to the generated classes, like BL methods.

Frans Bouma | Lead developer LLBLGen Pro