From e7b195d5659743eaf4d8af92a7696f5520ef8b7b Mon Sep 17 00:00:00 2001 From: Jeremy Meng Date: Sun, 3 Jan 2016 23:10:15 -0800 Subject: [PATCH] Fix build break for NET35 and add .editorconfig entry for *.cs. --- .editorconfig | 6 +++++- src/Castle.Core.Tests/TestDictionaryValidator.cs | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.editorconfig b/.editorconfig index ff2bd6942f..83ba41d322 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,9 +4,13 @@ root = true indent_style = tab [*.csproj] -intent_style = space +indent_style = space indent_size = 2 +[*.cs] +indent_style = tab +indent_size = 4 + [{project,global}.json] indent_style = space indent_size = 2 \ No newline at end of file diff --git a/src/Castle.Core.Tests/TestDictionaryValidator.cs b/src/Castle.Core.Tests/TestDictionaryValidator.cs index 6911bfa38e..0fb89c6fa2 100644 --- a/src/Castle.Core.Tests/TestDictionaryValidator.cs +++ b/src/Castle.Core.Tests/TestDictionaryValidator.cs @@ -16,6 +16,7 @@ namespace Castle.Components.DictionaryAdapter.Tests { using System; using System.Collections.Generic; + using System.Linq; using Castle.Core.Internal; @@ -51,7 +52,7 @@ public string Validate(IDictionaryAdapter dictionaryAdapter) foreach (var property in dictionaryAdapter.This.Properties.Values) { - var propertyRules = AttributesUtil.GetAttributes(property.Property); + var propertyRules = AttributesUtil.GetAttributes(property.Property).Select(x => (IValidationRule)x); var propertyValue = dictionaryAdapter.GetProperty(property.PropertyName, true); ApplyValidationRules(dictionaryAdapter, propertyRules, property, propertyValue, errors); ApplyValidationRules(dictionaryAdapter, globalRules, property, propertyValue, errors); @@ -65,7 +66,7 @@ public string Validate(IDictionaryAdapter dictionaryAdapter, PropertyDescriptor List errors = new List(); var globalRules = AttributesUtil.GetTypeAttributes(dictionaryAdapter.Meta.Type); - var propertyRules = AttributesUtil.GetAttributes(property.Property); + var propertyRules = AttributesUtil.GetAttributes(property.Property).Select(x => (IValidationRule)x); var propertyValue = dictionaryAdapter.GetProperty(property.PropertyName, true); ApplyValidationRules(dictionaryAdapter, propertyRules, property, propertyValue, errors); ApplyValidationRules(dictionaryAdapter, globalRules, property, propertyValue, errors);