Skip to content

Instantly share code, notes, and snippets.

@jahands
Created March 4, 2015 06:29
Show Gist options
  • Save jahands/eae930bb57fd5ec0ebe1 to your computer and use it in GitHub Desktop.
Save jahands/eae930bb57fd5ec0ebe1 to your computer and use it in GitHub Desktop.
public class User : IPerson, ICredential
{ ... }
public class UserConfiguration : EntityTypeConfiguration
{
// Add already made configurations for IPerson and ICredential
ConfigureAnyType(this, typeof(User));
}
public static void ConfigureAnyType(EntityTypeConfiguration<Type> entity, Type modelType)
{
delegate configureDelegates;
// Don't have the LINQ correct here..
// Basically want to add the delegate for each interface 'entity' inherits from
configureDelegates += configDelegateDict.Any(t => t.Value).Where(u => u.Key == type);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment