-
-
Save justinyoo/8b4f82dc7bafca780c15 to your computer and use it in GitHub Desktop.
CRM 2015 Filtering Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EntityFilteringService : ICodeWriterFilterService | |
{ | |
private readonly IFilterItemCollection _collection; | |
public EntityFilteringService(ICodeWriterFilterService defaultService) | |
{ | |
this.DefaultService = defaultService; | |
this._collection = FilterItemCollection.CreateInstance(); | |
} | |
... | |
public bool GenerateEntity(EntityMetadata entityMetadata, IServiceProvider services) | |
{ | |
var isValidEntity = this.IsValidEntity(entityMetadata.LogicalName); | |
return isValidEntity && this.DefaultService.GenerateEntity(entityMetadata, services); | |
} | |
... | |
private bool IsValidEntity(string entityName) | |
{ | |
var isValidEntity = this._collection.IsValidEntity(entityName); | |
return isValidEntity; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment