/// <summary> /// Sets read-only if ILookup. /// </summary> /// <param name="instance">The instance.</param> public void Apply( IClassInstance instance ) { if ( typeof( ILookup ).IsAssignableFrom ( instance.EntityType ) ) { instance.ReadOnly (); } }
/// <summary> /// Sets read-only if ILookup. /// </summary> /// <param name="instance">The instance.</param> public void Apply(IClassInstance instance) { if (typeof(ILookup).IsAssignableFrom(instance.EntityType)) { instance.ReadOnly(); } }
public void Apply(IClassInstance instance) { var tableAttr = instance.EntityType.GetCustomAttribute <TableAttribute>(); if (tableAttr != null) { if (!string.IsNullOrEmpty(tableAttr.Name)) { instance.Table(tableAttr.Name); } //TODO: unquote, prepend/append, quote if (!string.IsNullOrEmpty(tableAttr.Prefix)) { instance.Table($"`{tableAttr.Prefix}{instance.TableName.Trim('`')}`"); } if (!string.IsNullOrEmpty(tableAttr.Suffix)) { instance.Table($"`{instance.TableName.Trim('`')}{tableAttr.Suffix}`"); } if (tableAttr.View) { instance.ReadOnly(); instance.SchemaAction.None(); } } }
public void Apply(IClassInstance instance) { instance.ReadOnly(); }