Exemplo n.º 1
0
 public void Apply(FluentNHibernate.Conventions.Instances.IIdentityInstance instance)
 {
     instance.Column("Id");
     instance.UnsavedValue("0");
     //instance.GeneratedBy.Identity();
     //instance.GeneratedBy.HiLo("1000");
 }
 public void Apply(FluentNHibernate.Conventions.Instances.IVersionInstance instance)
 {
     instance.Column("RowVersion");
     instance.Not.Nullable();
     instance.UnsavedValue("0");
     instance.Default(1);
 }
Exemplo n.º 3
0
 public void Apply(FluentNHibernate.Conventions.Instances.IIdentityInstance instance)
 {
     if (Attribute.IsDefined(instance.EntityType, typeof(GeneratedByAssignedAttribute)))
         instance.GeneratedBy.Assigned();
     else
         instance.Column("Id");
 }
Exemplo n.º 4
0
        public void Apply(FluentNHibernate.Conventions.Instances.IPropertyInstance instance)
        {
            var regexString = @"([A-Z][\w^[A-Z]]*)([A-Z][\w^[A-Z]]*)*";

            var newName = Regex.Replace(instance.Name, regexString, (m => (m.Index != 0 ? "_" : "") + m.Value.ToLower()));

            instance.Column(newName);
        }
 public void Apply(FluentNHibernate.Conventions.Instances.IIdentityInstance instance)
 {
     instance.Column(instance.EntityType.Name + "Id");
 }
Exemplo n.º 6
0
 public void Apply(FluentNHibernate.Conventions.Instances.IManyToOneInstance instance)
 {
     instance.Column(instance.Property.Name + "Fk");
 }
 public void Apply(FluentNHibernate.Conventions.Instances.IPropertyInstance instance)
 {
     var columnName = ConventionsUtilities.CamelCaseToUpperCaseWithUnderscoreSeparator(instance.Property.Name);
     instance.Column(columnName);
 }
Exemplo n.º 8
0
 public void Apply(FluentNHibernate.Conventions.Instances.IIdentityInstance instance)
 {
     instance.Column(instance.EntityType.Name + "Id");
     instance.GeneratedBy.Assigned();
 }
Exemplo n.º 9
0
 public void Apply(FluentNHibernate.Conventions.Instances.IIdentityInstance instance)
 {
     instance.Column("Id");
     instance.UnsavedValue("0");
     instance.GeneratedBy.Sequence(instance.EntityType.Name+"_sequence");
 }
Exemplo n.º 10
0
 public void Apply(FluentNHibernate.Conventions.Instances.IIdentityInstance instance)
 {
     instance.Column("ID");
 }
Exemplo n.º 11
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);
 }