Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriySvyryd committed Oct 29, 2019
1 parent 498923c commit f780a3a
Show file tree
Hide file tree
Showing 560 changed files with 12,311 additions and 7,524 deletions.
24 changes: 19 additions & 5 deletions All.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_LINQ_QUERY/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_ARGUMENT/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_ARRAY_AND_OBJECT_INITIALIZER/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_FOR_STMT/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_PARAMETER/@EntryValue">False</s:Boolean>
Expand All @@ -65,8 +66,10 @@
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INITIALIZER_BRACES/@EntryValue">NEXT_LINE</s:String>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_EXISTING_EMBEDDED_ARRANGEMENT/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_EXISTING_INITIALIZER_ARRANGEMENT/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/LINE_FEED_AT_FILE_END/@EntryValue">True</s:Boolean>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/MAX_INITIALIZER_ELEMENTS_ON_LINE/@EntryValue">2</s:Int64>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_CONSTRUCTOR_INITIALIZER_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
Expand All @@ -80,12 +83,15 @@
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_MULTIPLICATIVE_OP/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_TYPEOF_PARENTHESES/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/STICK_COMMENT/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/STICK_COMMENT/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_AFTER_DECLARATION_LPAR/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_AFTER_INVOCATION_LPAR/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_ARRAY_INITIALIZER_STYLE/@EntryValue">CHOP_IF_LONG</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_BEFORE_ARROW_WITH_EXPRESSIONS/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_BEFORE_BINARY_OPSIGN/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_BEFORE_FIRST_TYPE_PARAMETER_CONSTRAINT/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_CHAINED_BINARY_EXPRESSIONS/@EntryValue">CHOP_IF_LONG</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_EXTENDS_LIST_STYLE/@EntryValue">CHOP_IF_LONG</s:String>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LIMIT/@EntryValue">140</s:Int64>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LINES/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_MULTIPLE_TYPE_PARAMEER_CONSTRAINTS_STYLE/@EntryValue">CHOP_ALWAYS</s:String>
Expand Down Expand Up @@ -167,10 +173,15 @@ Licensed under the Apache License, Version 2.0. See License.txt in the project r
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=NAMESPACE_005FALIAS/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FFIELD/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/UserRules/=XAML_005FRESOURCE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=13B3C0735924B9498D46F16CAB3349A2/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=13B3C0735924B9498D46F16CAB3349A2/RelativePath/@EntryValue">..\EFCore.sln.DotSettings</s:String>
<s:Boolean x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File13B3C0735924B9498D46F16CAB3349A2/@KeyIndexDefined">True</s:Boolean>
<s:Double x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File13B3C0735924B9498D46F16CAB3349A2/RelativePriority/@EntryValue">1</s:Double>


<s:Boolean x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=EF4F00E20178B341995BD2EFE53739B5/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=EF4F00E20178B341995BD2EFE53739B5/AbsolutePath/@EntryValue">C:\repos\EntityFrameworkCore\All.sln.DotSettings</s:String>
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=EF4F00E20178B341995BD2EFE53739B5/RelativePath/@EntryValue"></s:String>


<s:Boolean x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=FileEF4F00E20178B341995BD2EFE53739B5/@KeyIndexDefined">True</s:Boolean>
<s:Double x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=FileEF4F00E20178B341995BD2EFE53739B5/RelativePriority/@EntryValue">2</s:Double>
<s:String x:Key="/Default/Environment/PerformanceGuide/SwitchBehaviour/=VsBulb/@EntryIndexedValue">DO_NOTHING</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
Expand All @@ -187,13 +198,16 @@ Licensed under the Apache License, Version 2.0. See License.txt in the project r
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsWrapperSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EXml_002ECodeStyle_002EFormatSettingsUpgrade_002EXmlMoveToCommonFormatterSettingsUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=annotatable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=fallbacks/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=keyless/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=materializer/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=materializers/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=navigations/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=pushdown/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=remapper/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=requiredness/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=shaper/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=spatialite/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=sqlite/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=subquery/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unignore/@EntryIndexedValue">True</s:Boolean>
Expand Down
1 change: 0 additions & 1 deletion EFCore.sln.DotSettings

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#if NET461

using System;

namespace Microsoft.EntityFrameworkCore.Benchmarks.Initialization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ public static void ConfigureModel(DbModelBuilder modelBuilder)
modelBuilder.Entity<BusinessEntity>().Property(e => e.rowguid).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Computed);

modelBuilder.Entity<BusinessEntityAddress>().HasKey(
e => new { e.BusinessEntityID, e.AddressID, e.AddressTypeID });
e => new
{
e.BusinessEntityID,
e.AddressID,
e.AddressTypeID
});

modelBuilder.Entity<BusinessEntityAddress>().ToTable("BusinessEntityAddress", "Person");

Expand All @@ -172,7 +177,13 @@ public static void ConfigureModel(DbModelBuilder modelBuilder)
.WithMany(p => p.BusinessEntityAddress)
.HasForeignKey(d => d.BusinessEntityID);

modelBuilder.Entity<BusinessEntityContact>().HasKey(e => new { e.BusinessEntityID, e.PersonID, e.ContactTypeID });
modelBuilder.Entity<BusinessEntityContact>().HasKey(
e => new
{
e.BusinessEntityID,
e.PersonID,
e.ContactTypeID
});

modelBuilder.Entity<BusinessEntityContact>().ToTable("BusinessEntityContact", "Person");

Expand Down Expand Up @@ -341,7 +352,14 @@ public static void ConfigureModel(DbModelBuilder modelBuilder)
.WithOptional(p => p.Employee);

modelBuilder.Entity<EmployeeDepartmentHistory>()
.HasKey(e => new { e.BusinessEntityID, e.StartDate, e.DepartmentID, e.ShiftID });
.HasKey(
e => new
{
e.BusinessEntityID,
e.StartDate,
e.DepartmentID,
e.ShiftID
});

modelBuilder.Entity<EmployeeDepartmentHistory>().ToTable("EmployeeDepartmentHistory", "HumanResources");

Expand Down Expand Up @@ -447,7 +465,13 @@ public static void ConfigureModel(DbModelBuilder modelBuilder)
.WithMany(p => p.PersonCreditCard)
.HasForeignKey(d => d.CreditCardID);

modelBuilder.Entity<PersonPhone>().HasKey(e => new { e.BusinessEntityID, e.PhoneNumber, e.PhoneNumberTypeID });
modelBuilder.Entity<PersonPhone>().HasKey(
e => new
{
e.BusinessEntityID,
e.PhoneNumber,
e.PhoneNumberTypeID
});

modelBuilder.Entity<PersonPhone>().ToTable("PersonPhone", "Person");

Expand Down Expand Up @@ -602,7 +626,13 @@ public static void ConfigureModel(DbModelBuilder modelBuilder)
.HasForeignKey(d => d.ProductModelID);

modelBuilder.Entity<ProductModelProductDescriptionCulture>()
.HasKey(e => new { e.ProductModelID, e.ProductDescriptionID, e.CultureID });
.HasKey(
e => new
{
e.ProductModelID,
e.ProductDescriptionID,
e.CultureID
});

modelBuilder.Entity<ProductModelProductDescriptionCulture>().ToTable("ProductModelProductDescriptionCulture", "Production");

Expand Down Expand Up @@ -921,7 +951,13 @@ public static void ConfigureModel(DbModelBuilder modelBuilder)
.WithMany(p => p.SalesTerritory)
.HasForeignKey(d => d.CountryRegionCode);

modelBuilder.Entity<SalesTerritoryHistory>().HasKey(e => new { e.BusinessEntityID, e.StartDate, e.TerritoryID });
modelBuilder.Entity<SalesTerritoryHistory>().HasKey(
e => new
{
e.BusinessEntityID,
e.StartDate,
e.TerritoryID
});

modelBuilder.Entity<SalesTerritoryHistory>().ToTable("SalesTerritoryHistory", "Sales");

Expand Down Expand Up @@ -1114,7 +1150,13 @@ public static void ConfigureModel(DbModelBuilder modelBuilder)
.WithMany(p => p.WorkOrder)
.HasForeignKey(d => d.ScrapReasonID);

modelBuilder.Entity<WorkOrderRouting>().HasKey(e => new { e.WorkOrderID, e.ProductID, e.OperationSequence });
modelBuilder.Entity<WorkOrderRouting>().HasKey(
e => new
{
e.WorkOrderID,
e.ProductID,
e.OperationSequence
});

modelBuilder.Entity<WorkOrderRouting>().ToTable("WorkOrderRouting", "Production");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ private void EnsureDatabaseCreated(Action<DbContext> seedAction)
private bool IsDatabaseCorrect(OrdersContext context)
{
return context.Database.CompatibleWithModel(throwIfNoMetadata: true)
&& _productCount == context.Products.Count()
&& _customerCount == context.Customers.Count()
&& (_customerCount * _ordersPerCustomer == context.Orders.Count())
&& (_customerCount * _ordersPerCustomer * _linesPerOrder == context.OrderLines.Count());
&& _productCount == context.Products.Count()
&& _customerCount == context.Customers.Count()
&& (_customerCount * _ordersPerCustomer == context.Orders.Count())
&& (_customerCount * _ordersPerCustomer * _linesPerOrder == context.OrderLines.Count());
}

private void InsertSeedData()
Expand Down
2 changes: 0 additions & 2 deletions benchmark/EF6.SqlServer.Benchmarks/Support/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.



// ReSharper disable once CheckNamespace
namespace Microsoft.EntityFrameworkCore.Benchmarks
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,13 @@ public static void ConfigureModel(ModelBuilder modelBuilder)
modelBuilder.Entity<BusinessEntityAddress>(
entity =>
{
entity.HasKey(e => new { e.BusinessEntityID, e.AddressID, e.AddressTypeID });
entity.HasKey(
e => new
{
e.BusinessEntityID,
e.AddressID,
e.AddressTypeID
});

entity.ToTable("BusinessEntityAddress", "Person");

Expand All @@ -184,7 +190,13 @@ public static void ConfigureModel(ModelBuilder modelBuilder)
modelBuilder.Entity<BusinessEntityContact>(
entity =>
{
entity.HasKey(e => new { e.BusinessEntityID, e.PersonID, e.ContactTypeID });
entity.HasKey(
e => new
{
e.BusinessEntityID,
e.PersonID,
e.ContactTypeID
});

entity.ToTable("BusinessEntityContact", "Person");

Expand Down Expand Up @@ -394,7 +406,14 @@ public static void ConfigureModel(ModelBuilder modelBuilder)
modelBuilder.Entity<EmployeeDepartmentHistory>(
entity =>
{
entity.HasKey(e => new { e.BusinessEntityID, e.StartDate, e.DepartmentID, e.ShiftID });
entity.HasKey(
e => new
{
e.BusinessEntityID,
e.StartDate,
e.DepartmentID,
e.ShiftID
});

entity.ToTable("EmployeeDepartmentHistory", "HumanResources");

Expand Down Expand Up @@ -528,7 +547,13 @@ public static void ConfigureModel(ModelBuilder modelBuilder)
modelBuilder.Entity<PersonPhone>(
entity =>
{
entity.HasKey(e => new { e.BusinessEntityID, e.PhoneNumber, e.PhoneNumberTypeID });
entity.HasKey(
e => new
{
e.BusinessEntityID,
e.PhoneNumber,
e.PhoneNumberTypeID
});

entity.ToTable("PersonPhone", "Person");

Expand Down Expand Up @@ -712,7 +737,13 @@ public static void ConfigureModel(ModelBuilder modelBuilder)
modelBuilder.Entity<ProductModelProductDescriptionCulture>(
entity =>
{
entity.HasKey(e => new { e.ProductModelID, e.ProductDescriptionID, e.CultureID });
entity.HasKey(
e => new
{
e.ProductModelID,
e.ProductDescriptionID,
e.CultureID
});

entity.ToTable("ProductModelProductDescriptionCulture", "Production");

Expand Down Expand Up @@ -1096,7 +1127,13 @@ public static void ConfigureModel(ModelBuilder modelBuilder)
modelBuilder.Entity<SalesTerritoryHistory>(
entity =>
{
entity.HasKey(e => new { e.BusinessEntityID, e.StartDate, e.TerritoryID });
entity.HasKey(
e => new
{
e.BusinessEntityID,
e.StartDate,
e.TerritoryID
});

entity.ToTable("SalesTerritoryHistory", "Sales");

Expand Down Expand Up @@ -1344,7 +1381,13 @@ public static void ConfigureModel(ModelBuilder modelBuilder)
modelBuilder.Entity<WorkOrderRouting>(
entity =>
{
entity.HasKey(e => new { e.WorkOrderID, e.ProductID, e.OperationSequence });
entity.HasKey(
e => new
{
e.WorkOrderID,
e.ProductID,
e.OperationSequence
});

entity.ToTable("WorkOrderRouting", "Production");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ private bool IsDatabaseCorrect(OrdersContextBase context)
}

return (_productCount == context.Products.Count())
&& (_customerCount == context.Customers.Count())
&& (_customerCount * _ordersPerCustomer == context.Orders.Count())
&& (_customerCount * _ordersPerCustomer * _linesPerOrder == context.OrderLines.Count());
&& (_customerCount == context.Customers.Count())
&& (_customerCount * _ordersPerCustomer == context.Orders.Count())
&& (_customerCount * _ordersPerCustomer * _linesPerOrder == context.OrderLines.Count());
}

private void InsertSeedData()
Expand Down
Loading

0 comments on commit f780a3a

Please sign in to comment.