/src/EntityFramework/ModelConfiguration/Conventions/Sets/V2ConventionSet.cs

# · C# · 31 lines · 24 code · 7 blank · 0 comment · 2 complexity · 19a7b920c3eeb10017d27eca32763147 MD5 · raw file

  1. namespace System.Data.Entity.ModelConfiguration.Conventions.Sets
  2. {
  3. using System.Collections.Generic;
  4. using System.Diagnostics.CodeAnalysis;
  5. using System.Diagnostics.Contracts;
  6. internal static class V2ConventionSet
  7. {
  8. private static readonly IConvention[] _conventions;
  9. [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")]
  10. static V2ConventionSet()
  11. {
  12. var conventions = new List<IConvention>(V1ConventionSet.Conventions);
  13. var columnOrderingConventionIndex
  14. = conventions.FindIndex(c => c.GetType() == typeof(ColumnOrderingConvention));
  15. Contract.Assert(columnOrderingConventionIndex != -1);
  16. conventions[columnOrderingConventionIndex] = new ColumnOrderingConventionStrict();
  17. _conventions = conventions.ToArray();
  18. }
  19. public static IConvention[] Conventions
  20. {
  21. get { return _conventions; }
  22. }
  23. }
  24. }