views:

327

answers:

3

is there a way Generate C# automatic properties with Codedom or maybe an other set of libreries that i can use ?

+2  A: 

No, it's not: C# CodeDom Automatic Property

Take a look into this article to get some useful examples

Rubens Farias
so are there any other libraries that i can use ?
Yassir
@Yassir It's really not that hard to create a backing field and use them in getter/setter.
chakrit
you dont need; as Marc Gravell said, you need to implement it yourself, as they are just a compiler trick (i.e. .net compiler creates a private variable to hold your automatic property value)
Rubens Farias
actually i'm not compiling the generated code i add it to a project so i need the generated classes to have automatic properties
Yassir
In that case, you could to use a `CodeSnippetStatement` and hardcode that property
Rubens Farias
+1  A: 

CodeDom is supposed to be some sort of AST which can be converted to multiple languages (typically C# and VB.NET). Therefore, you'll not find features which are syntactic sugar of a specific language in CodeDom.

Lucero
A: 

This one is very good

CodeHelper 1.5.x

-Properties generator from variable(s)
-Entity Class generator from tables
-Store procedure and SQL Statetments generator from tables
-Methods for insert/update/delete records
-Move code easily between regions
-Methods locator
-Backup for Solution and projects
-and many others, take a look

you can download it from: http://www.bluemusa.com/codehelper/codehelper.htm

rafaelsr