jbubriski / ST4bby

A POCO generator that doesn't rely on the Entity Framework.
MIT License
17 stars 8 forks source link

Static constructors #15

Closed LosManos closed 12 years ago

LosManos commented 12 years ago

! I just noticed that when merging and diffing I lost some code and now when I try to push new code to github it says "everyting is up-to-date" :-( The code I checked in works (it compiles) but the settings don't work. !

I have created partial classes, settable in settings if the classes should be partial or not. I have created static constructors. The names and if they should be created at all is settable.

I have used partial classes earlier with Codesmith/nettiers and been very satisfied. It makes it possible for the user to add functionality in their classes at will; without having to dive into St4bby.

I also like to have constructors that takes all parameters to make sure they are fully populated. See: http://www.selfelected.com/make-sure-your-objects-are-fully-populated-%E2%80%93-fail-at-once/ I made the constructors static so as to give the user more freedom. If they had been "normal" constructors I would also have had to create a default constructor and then the user can't write his own. I made 2 constructors, one with all parameters and one with the primary key lacking.

LosManos commented 12 years ago

Forget this. I had got the wrong code somewhere. I can't find no way to delete a pull request, only close it.