/// <summary> /// Applies Index based on type. /// </summary> /// <param name="instance">The instance.</param> public void Apply( IPropertyInstance instance ) { CreateUniqeIndexIfIndicated ( instance.Property, instance.Unique, instance.UniqueKey ); var sourceName = instance.EntityType.Name; var propertyName = instance.Property.Name; if ( typeof( ILookup ).IsAssignableFrom ( instance.EntityType ) ) { sourceName += "Lkp"; } if ( typeof( ILookup ).IsAssignableFrom ( instance.Property.PropertyType ) ) { propertyName += "Lkp"; } var indexAttribute = instance.Property.MemberInfo.GetCustomAttributes ( typeof( NaturalIndexAttribute ), false ); if ( indexAttribute.Length > 0 ) { var indexName = string.Format ( "{0}_{1}_IDX", sourceName, propertyName ); instance.Index ( indexName ); } }
/// <summary> /// Applies Index based on type. /// </summary> /// <param name="instance">The instance.</param> public void Apply(IPropertyInstance instance) { CreateUniqeIndexIfIndicated(instance.Property, instance.Unique, instance.UniqueKey); var sourceName = instance.EntityType.Name; var propertyName = instance.Property.Name; if (typeof(ILookup).IsAssignableFrom(instance.EntityType)) { sourceName += "Lkp"; } if (typeof(ILookup).IsAssignableFrom(instance.Property.PropertyType)) { propertyName += "Lkp"; } var indexAttribute = instance.Property.MemberInfo.GetCustomAttributes( typeof(NaturalIndexAttribute), false); if (indexAttribute.Length > 0) { var indexName = string.Format("{0}_{1}_IDX", sourceName, propertyName); instance.Index(indexName); } }
public void Apply(IPropertyInstance instance) { if (instance.Property.Name == "Guid" && instance.Property.PropertyType == typeof(Guid)) { instance.Access.ReadOnlyPropertyThroughCamelCaseField(CamelCasePrefix.Underscore); instance.Index(string.Format("IX_{0}_{1}", instance.EntityType.Name, instance.Property.Name)); } }
public void Apply(IPropertyInstance instance) { if (instance.Property.Name == "Guid" && instance.Property.PropertyType == typeof (Guid)) { instance.Access.ReadOnlyPropertyThroughCamelCaseField(CamelCasePrefix.Underscore); instance.Index(string.Format("IX_{0}_{1}", instance.EntityType.Name, instance.Property.Name)); } }
public void Apply(IPropertyInstance instance) { Entities.BaseEntity e; if (instance.Name == nameof(e.InstitutionCode) && instance.Property.PropertyType == typeof(string)) { instance.Index("ind_InstitutionCode"); } }
public void Apply(IPropertyInstance instance) { if (!ConfigurationHelper.AppSettingsItem <bool>("SingleTenant")) { Entities.BaseEntity e; if (instance.Name == nameof(e.InstitutionCode) && instance.Property.PropertyType == typeof(string)) { instance.Index("ind_InstitutionCode"); } } }
protected override void Apply(IndexedAttribute attribute, IPropertyInstance instance) { var name = (attribute.Name ?? instance.Name).ToUpperInvariant(); if (attribute.Unique) { instance.UniqueKey($"UNQ_{name}"); } else { instance.Index($"IDX_{name}"); } }
public void Apply(IPropertyInstance instance) { if (instance.Name == "DocumentType") { instance.Index(string.Format("IX_{0}_{1}", instance.EntityType.Name, instance.Property.Name)); } if (instance.Name == "IsDeleted") { instance.Index(string.Format("IX_{0}_{1}", instance.EntityType.Name, instance.Property.Name)); } if (instance.Name == "UrlSegment") { instance.Index(string.Format("IX_{0}_{1}", instance.EntityType.Name, instance.Property.Name)); } if (instance.Name == "BaseUrl") { instance.Index(string.Format("IX_{0}_{1}", instance.EntityType.Name, instance.Property.Name)); } if (instance.Name == "ParentId") { instance.Index(string.Format("IX_{0}_{1}", instance.EntityType.Name, instance.Property.Name)); } if (instance.Name == "PublishOn") { instance.Index(string.Format("IX_{0}_{1}", instance.EntityType.Name, instance.Property.Name)); } if (instance.Name == "DisplayOrder") { instance.Index(string.Format("IX_{0}_{1}", instance.EntityType.Name, instance.Property.Name)); } if (instance.Name == "SiteId") { instance.Index(string.Format("IX_{0}_{1}", instance.EntityType.Name, instance.Property.Name)); } }
protected override void Apply(IndexAttribute attribute, IPropertyInstance instance) { instance.Index(attribute.IsKeySet ? GetIndexName(instance.EntityType.Name, attribute.KeyName) : GetIndexName(instance.EntityType.Name, instance.Name)); }
protected override void Apply(IndexableAttribute attribute, IPropertyInstance instance) { instance.Index(attribute.GetName()); }
protected override void Apply(IndexedAttribute attribute, IPropertyInstance instance) { instance.Index("idx__" + instance.Property.Name); }