How to pass variable entities to a generic function?

.net c# entity-framework entity-framework-plus generics

Accepted Answer

ZZZ_tmp
2
4/19/2017 12:52:27 PM

Popular Answer

Making the entities you don't want reviewed implement the same interface and then excluding that is an alternative to looping over your entity types. For instance:

public interface IExcludeFromAudit
{ }

Your entities also:

public class Order : IExcludeFromAudit
{
    //snip
}

Now simply take the interface out:

AuditManager.DefaultConfiguration.Exclude<IExcludeFromAudit>();

This has the advantage of making it simple to decide which people are excluded.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow