WCF RIA Services Contrib is an open-source CodePlex project, maintained by Colin Blair, which consists of a collection of community contributions that can be used with WCF RIA Services. At the moment, it consists of ComboBoxExtensions, a Data Validation Framework, Entity Tools, Entity Graph, Fluent Metadata API & T4RIA – you can find more info on those here.
Recently, I contributed a bunch of extension methods to the Entity Tools component. These are methods I tend to use in projects, so I figured: why not release them to the community? 🙂
An overview:
- public static IEnumerable YieldChildEntities(this Entity parent, EntityChangeSet changeSet,
bool includeDirectChildrenOfEntityBaseType = false)
- public static IEnumerable YieldChildEntities(this Entity parent, EntityContainer container,
bool includeDirectChildrenOfEntityBaseType = false)
- public static void DeleteChildEntities(this Entity parent, EntityContainer container,
bool includeDirectChildrenOfEntityBaseType = false)
- public static void DetachChildEntities(this Entity parent, EntityContainer container,
bool includeDirectChildrenOfEntityBaseType = false)
- public static void RejectChangesOnChildEntities(this Entity parent, EntityContainer container,
bool includeDirectChildrenOfEntityBaseType = false)
- public static void RejectChangesOnChildEntities(this Entity parent, EntityChangeSet changeSet,
bool includeDirectChildrenOfEntityBaseType = false)
- public static void AttachRange<T>(this EntitySet<T> entitySet, IEnumerable<T> entitiesToAttach) where T : Entity
- public static IEnumerable<T> GetEntitiesOfType<T>(this EntityChangeSet changeSet, bool includeAddedEntites = true, bool includeModifiedEntities = true, bool includeDeletedEntities = false) where T : Entity
- public static bool HasValidationErrors(this System.ServiceModel.DomainServices.Client.SubmitOperation submitOperation)
- public static bool HasValidationErrors<T>(this System.ServiceModel.DomainServices.Client.SubmitOperation submitOperation) where T:Entity
- public static IEnumerable<ValidationResult> GetAllValidationErrors(this System.ServiceModel.DomainServices.Client.SubmitOperation submitOperation)
- public static IEnumerable<ValidationResult> GetAllValidationErrors<T>(this System.ServiceModel.DomainServices.Client.SubmitOperation submitOperation) where T:Entity
At the moment, the only way to access these is by downloading the source code, but in the (near) future, they will be included in the NuGet package for Entity Tools, so you might want to keep an eye on that.
Enjoy! 🙂