Exemplo n.º 1
0
 public TableFluentConfig()
 {
     if (FluentCache.GetAttribute <TableAttribute>(typeof(TEntity)) == default)
     {
         FluentCache.SetAttribute(typeof(TEntity), new TableAttribute());
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        public ColumnFluentConfig <TEntity> Ignore(bool ignore = true)
        {
            var attribute = FluentCache.GetAttribute <ColumnAttribute>(_property);

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

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

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

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

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