ado.net entity framework newby question

  • Thread starter Thread starter doph
  • Start date Start date
D

doph

Hi,

I have downloaded and installed beta 3 of Ado.net entity framework and
played with this a little bit and it's quite cool - I can query the
database and get the objects etc. The only thing I can't dig to is how
to actually create custom attributes in the classes that the framework
has generated for me.

For example, say, I have a simple table:

UserId,
UserName,
UserAge

and I want a custom properry, say, IsOld that will be calculated at
runtime, something like

public bool IsOld{
get{
if (UserAge > 90){return true;}
else {return false;}

}
}

how do I do this?

Thanks for all your comments!
 
Hi,

Generated classes are partial.
Thus you can simply create another partial class with same name living in
same namespace and add your property there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top