Пример #1
0
        public void Apply(IPropertyInstance instance)
        {
            var attributes = instance.Property.MemberInfo.GetCustomAttributes(true)
                             .Where(x => x is FormulaAttribute)
                             .Select(x => x as FormulaAttribute)
                             .ToList();

            foreach (var attribute in attributes)
            {
                instance.Formula(ReplaceBoolean(attribute.SqlFormula));
            }
        }
Пример #2
0
        public void Apply(IPropertyInstance instance)
        {
            var attributes = instance.Property.MemberInfo.GetCustomAttributes(true)
                             .Where(x => x is FormulaAttribute)
                             .Select(x => x as FormulaAttribute)
                             .ToList();

            foreach (var attribute in attributes)
            {
                if (attribute.DatabaseType == null || attribute.DatabaseType == _databaseTypeAccessor.GetDatabaseType())
                {
                    var sql = ReplaceRegex.Replace(attribute.SqlFormula, m => _namingStrategy.ColumnName(m.Value.Trim('`')));
                    instance.Formula(sql);
                }
            }
        }
 protected override void Apply(FilterCurrentLanguageAttribute attribute, IPropertyInstance instance)
 {
     // The real formula will be set in the NHMappings event listener.
     // We need to set the formula here in order to prevent fluent nh to create a column mapping.
     instance.Formula("Id");
 }
 protected override void Apply(FormulaAttribute attribute, IPropertyInstance instance)
 {
     instance.Formula(attribute.SqlFormula);
 }
Пример #5
0
 public void Apply(IPropertyInstance instance)
 {
     instance.Formula(FormulaValue);
 }