Created
February 4, 2009 17:10
-
-
Save stevenharman/58213 to your computer and use it in GitHub Desktop.
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
using System; | |
using System.Reflection; | |
using FluentNHibernate.AutoMap; | |
using FluentNHibernate.Framework; | |
using MyApplication.Core.Domain; | |
namespace MyApplication.Core.Persistence | |
{ | |
public class MyApplicationPersistenceModel : AutoPersistenceModel | |
{ | |
public MyApplicationPersistenceModel() | |
{ | |
AddEntityAssembly(Assembly.GetAssembly(typeof(ValueObject<>))) | |
.WithConvention(c => c.IsBaseType = is_layer_super_type) | |
.Where(t => t.Namespace == "MyApplication.Core.Domain" && !is_layer_super_type(t)); | |
} | |
private static bool is_layer_super_type(Type type) | |
{ | |
return (type == typeof(Entity) || type == typeof(ValueObject<>)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment