>>>Hi everybody,
>>>
>>>I am creating the classes for my tables by hand - I am working on a utility application which I already wrote in VFP and I am working on ASP.NET MVC version of it.
>>>
>>>In one of the queries I use the following
>>>
>>>select Table.Col1, Table.Col2, Table.End_Num - Table.Start_Num + 1 as quantity from myTable Table.
>>>
>>>I've checked this link
>>>
http://stackoverflow.com/questions/6944904/how-should-i-access-a-computed-column-in-entity-framework-code-first>>>
>>>but it is still not clear to me. I don't have this column as computed in my database, but I think it will be nice to have it as a property in the class. The question is - how should I define such property which is not a column in a table but rather some simple computed expression?
>>>
>>>Thanks in advance.
>>
>>try a google search... add computed properties to entity framework model
>
>Yes, all Google searches result in StackOverflow questions so far and they don't yet explain what I'm asking. I don't have the computed column in the database and I don't want to add it to the table. So, should it be something like
>
>class ClientOrder
>{
>ClientOrder
>{
> this.Quantity = this.EndNum - this.StartNum + 1;
>}
>
>[Computed] // Do I need this attribute here?
>public virtual Quantity {set;}
>}
>
In the spare 2 minutes before replying, did you google what I posted. I get a link that tells you exactly what to do and its not expert's exchange. Why don't you try to figure it out for a while before asking others to do your work for you...