How to extend abstract Entity class in RIA Services
Posted
by
Calanus
on Stack Overflow
See other posts from Stack Overflow
or by Calanus
Published on 2010-12-24T09:59:57Z
Indexed on
2010/12/24
10:54 UTC
Read the original article
Hit count: 228
I want to add a bool variable and property to the base Entity class in my RIA services project so that it is available throughout all the entity objects but seem unable to work out how to do this. I know that adding properties to actual entities themselves is easy using .shared.cs and partial classes but adding such properties to the Entity class using similar methods doesn't work.
For example, the following code doesn't work
namespace System.ServiceModel.DomainServices.Client
{
public abstract partial class Entity
{
private bool auditRequired;
public bool AuditRequired
{
get { return auditRequired; }
set { auditRequired = value; }
}
}
}
All that happens is that the existing Entity class gets totally overriden rather than extending the Entity class.
How do I extend the base Entity class so that functionality is available thoughout all derived entity classes?
© Stack Overflow or respective owner