Exemplo n.º 1
0
        public void Apply(FNH.Conventions.Instances.IManyToOneInstance instance)
        {
            //instance.Column(instance.Property.Name); --seems to be superfluous, and moveover, breaks with newer versions

            if (instance.Property.MemberInfo.IsDefined(typeof(RequiredAttribute), false))
                instance.Not.Nullable();

            instance.ForeignKey(string.Format("FK_{0}_{1}",
                instance.EntityType.Name,
                instance.Name));
        }
Exemplo n.º 2
0
 public void Apply(FluentNHibernate.Conventions.Instances.IManyToOneInstance instance)
 {
     instance.Fetch.Join();
     instance.Column(instance.Property.Name + "Id");
     instance.ForeignKey("Fk_" + instance.EntityType.Name + "_" + instance.Property.Name);
 }