>I need to override property.
>The following code causes error. So I cannot declare virtual property for this.
>
>How to use virtual in this code ?
>
>
>class BusinessObject<EntityType> {
> // Why next line causes error: The modifier 'virtual' is not valid for this item?
> public virtual EntityType Entity;
>}
>
>class mybizobj : BusinessObject<MyEntity> {
> public override MyEntity Entity {
> get {
> return null;
> }
> }
>}
>
>public class MyEntity { string myProperty;}
>
Andrus,
You cannot use virtual/override for fields. You can however use it for properties (reread your code you're not using it with a property but field).
public virtual EntityType Entity
{
get {}
set {}
}
Cetin