Custom Property Descriptors

I will show from the beginning how to create advanced RIA applications, step by step, First defining the tools needed and how to implement them. I created an advanced  automatic DAL like EntityFramework but it doesn’t add any code and works with lambda expressions, based on Automatic Access DAL , when I didn’t know anything about MVVM.

To make automatically the fields in the database based on the fields of our model, we have to define a custom descriptor, like the following:

public class EntityDescriptionAttribute : DescriptionAttribute
public EntityDescriptionAttribute(String description)
this.DescriptionValue = description;

This descriptor allows us to define if a field will be selected, inserted, updated or deleted in the database.

Any entity in our database will inherit from:

public class BaseEntity
public Int32 ID;

public Boolean IsDeleted;

public BaseEntity() { ID = -1; IsDeleted = false; }

The descriptor will be the field name in the database, and all the data will have an ID, and in this case I do not delete information, I just set the IsDeleted flag.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s