Moved to fluent. Added support for Modifiers. Fixtures to load intial test data
This commit is contained in:
1 parent
c841dc25f4
commit
eb48c3754a
272 files changed
+10470
-47160
No files matched your search
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using FluentNHibernate.Conventions;
|
||||
using System.Reflection;
|
||||
using FluentNHibernate;
|
||||
using FluentNHibernate.Conventions.Instances;
|
||||
using FluentNHibernate.Conventions.Inspections;
|
||||
using FluentNHibernate.Conventions.AcceptanceCriteria;
|
||||
|
||||
namespace Tanshu.Accounts.Conventions
|
||||
{
|
||||
public class EnumConvention : IUserTypeConvention
|
||||
{
|
||||
public void Accept(IAcceptanceCriteria<IPropertyInspector> criteria)
|
||||
{
|
||||
criteria.Expect(x => (x.Property.PropertyType.IsEnum
|
||||
|| (x.Property.PropertyType.IsGenericType &&
|
||||
x.Property.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>) &&
|
||||
x.Property.PropertyType.GetGenericArguments()[0].IsEnum)));
|
||||
//criteria.Expect(x => x.Property.PropertyType.IsEnum);
|
||||
}
|
||||
|
||||
public void Apply(IPropertyInstance target)
|
||||
{
|
||||
target.CustomType(target.Property.PropertyType);
|
||||
}
|
||||
}
|
||||
|
||||
//public class EnumConvention : IPropertyConvention, IPropertyConventionAcceptance
|
||||
//{
|
||||
// #region IPropertyConvention Members
|
||||
|
||||
// public void Apply(IPropertyInstance instance)
|
||||
// {
|
||||
// instance.CustomType(instance.Property.PropertyType);
|
||||
// }
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region IPropertyConventionAcceptance Members
|
||||
|
||||
// public void Accept(IAcceptanceCriteria<IPropertyInspector> criteria)
|
||||
// {
|
||||
// criteria.Expect(x => x.Property.PropertyType.IsEnum ||
|
||||
// (x.Property.PropertyType.IsGenericType &&
|
||||
// x.Property.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>) &&
|
||||
// x.Property.PropertyType.GetGenericArguments()[0].IsEnum)
|
||||
// );
|
||||
// }
|
||||
|
||||
// #endregion
|
||||
|
||||
//}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user