示例#1
0
 /// <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 ();
     }
 }
示例#2
0
 /// <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();
                }
            }
        }
示例#4
0
 public void Apply(IClassInstance instance)
 {
     instance.ReadOnly();
 }