Example #1
0
 public TableFluentConfig()
 {
     if (FluentCache.GetAttribute <TableAttribute>(typeof(TEntity)) == default)
     {
         FluentCache.SetAttribute(typeof(TEntity), new TableAttribute());
     }
 }
Example #2
0
        public TableFluentConfig <TEntity> Name(string name)
        {
            var attribute = FluentCache.GetAttribute <TableAttribute>(typeof(TEntity));

            attribute.Name = name;
            FluentCache.SetAttribute(typeof(TEntity), attribute);
            return(this);
        }
Example #3
0
        public ColumnFluentConfig <TEntity> Ignore(bool ignore = true)
        {
            var attribute = FluentCache.GetAttribute <ColumnAttribute>(_property);

            attribute.Ignore = ignore;
            FluentCache.SetAttribute(_property, attribute);
            return(this);
        }
Example #4
0
        public ColumnFluentConfig <TEntity> Name(string name)
        {
            var attribute = FluentCache.GetAttribute <ColumnAttribute>(_property);

            attribute.Name = name;
            FluentCache.SetAttribute(_property, attribute);
            return(this);
        }
Example #5
0
        public KeyFluentConfig <TEntity> AutoIdentity(bool autoIdentity = true)
        {
            var attribute = FluentCache.GetAttribute <KeyAttribute>(_property);

            attribute.AutoIdentity = autoIdentity;
            FluentCache.SetAttribute(_property, attribute);
            return(this);
        }
Example #6
0
        public BinaryFluentConfig(PropertyInfo property)
        {
            _property = property;

            if (FluentCache.GetAttribute <BinaryAttribute>(property) == default)
            {
                FluentCache.SetAttribute(property, new BinaryAttribute());
            }
        }
Example #7
0
        public ColumnFluentConfig(PropertyInfo property)
        {
            _property = property;

            if (FluentCache.GetAttribute <ColumnAttribute>(property) == default)
            {
                FluentCache.SetAttribute(property, new ColumnAttribute());
            }
        }
Example #8
0
 public static T GetAttribute <T>(PropertyInfo propertyInfo) where T : Attribute
 => EntityCache.GetAttribute <T>(propertyInfo) ?? FluentCache.GetAttribute <T>(propertyInfo);
Example #9
0
 public static T GetAttribute <T>(Type type) where T : Attribute
 => EntityCache.GetAttribute <T>(type) ?? FluentCache.GetAttribute <T>(type);