do these need to be used in conjunction with one another, or is this an either/or scenario.
I'm trying to implement concurrency and this is what i have. I seems redundant to me to leave the object only to return for the predicate.
public partial class EquipmentStatusEntity
{
protected override void OnInitialized()
{
base.OnInitialized();
this.ConcurrencyPredicateFactoryToUse = new ConcurrencyPredicateFactory();
}
public override IPredicateExpression GetConcurrencyPredicate(ConcurrencyPredicateType predicateTypeToCreate)
{
return new PredicateExpression(EquipmentStatusFields.UpdatedOn == this.Fields[(int)EquipmentStatusFieldIndex.UpdatedOn].DbValue);
}
}
public partial class ConcurrencyPredicateFactory : IConcurrencyPredicateFactory
{
#region IConcurrencyPredicateFactory Members
public IPredicateExpression CreatePredicate(ConcurrencyPredicateType predicateTypeToCreate, object containingEntity)
{
IEntity2 entity = (IEntity2)containingEntity;
if (entity == null)
{
throw new ArgumentException(string.Format("{0} does not inherit {1}", containingEntity.GetType().FullName, typeof(IEntity2).FullName), "containingEntity");
}
return entity.GetConcurrencyPredicate(predicateTypeToCreate);
}
#endregion
}