예제 #1
0
        public void Configure(PropertyInfo property, IEnumerable <Attribute> propertyAttributes, EntityConfigAccessor configAccessor)
        {
            var roundAttribute = propertyAttributes.FirstOrDefault(attr => attr is RoundValueAttribute);

            if (roundAttribute != null)
            {
                configAccessor
                .GetPropertyConfiguration(property.Name)
                .ExtraSettings
                .Add(RoundValueAttribute.PARAMETER_NAME, (roundAttribute as RoundValueAttribute).Precision);
            }
        }
        public void Configure(PropertyInfo property, IEnumerable <Attribute> propertyAttributes, EntityConfigAccessor configAccessor)
        {
            var jsonIgnoreAttribute   = propertyAttributes.FirstOrDefault(attr => attr is JsonIgnoreAttribute);
            var jsonPropertyAttribute = propertyAttributes.FirstOrDefault(attr => attr is JsonPropertyAttribute);

            if (jsonIgnoreAttribute != null)
            {
                configAccessor.EntityConfig.IgnoreOnPatching(property.Name);
            }

            if (jsonPropertyAttribute != null)
            {
                configAccessor.EntityConfig.UseJsonAlias(property.Name, (jsonPropertyAttribute as JsonPropertyAttribute).PropertyName);
            }
        }