From 51884e6ff64361c7ba8d24937f5c17b96cc98bed Mon Sep 17 00:00:00 2001 From: Tom Pipinic Date: Thu, 8 Dec 2022 14:44:47 +0100 Subject: [PATCH] Refactoring namespaces --- .editorconfig | 226 ++++++++++++++++++ TomPIT.Connected.sln => Connected.Host.sln | 20 +- .../Configuration/MicroServiceDescriptor.cs | 2 +- .../Configuration/SysConfiguration.cs | 2 +- .../Connected.Host.csproj | 0 .../Program.cs | 4 +- .../Properties/launchSettings.json | 0 .../appsettings.Development.json | 0 .../appsettings.json | 0 {TomPIT.Connected => Connected.Host}/sys.json | 50 ++-- 10 files changed, 265 insertions(+), 39 deletions(-) create mode 100644 .editorconfig rename TomPIT.Connected.sln => Connected.Host.sln (80%) rename {TomPIT.Connected => Connected.Host}/Configuration/MicroServiceDescriptor.cs (73%) rename {TomPIT.Connected => Connected.Host}/Configuration/SysConfiguration.cs (96%) rename TomPIT.Connected/TomPIT.Connected.csproj => Connected.Host/Connected.Host.csproj (100%) rename {TomPIT.Connected => Connected.Host}/Program.cs (96%) rename {TomPIT.Connected => Connected.Host}/Properties/launchSettings.json (100%) rename {TomPIT.Connected => Connected.Host}/appsettings.Development.json (100%) rename {TomPIT.Connected => Connected.Host}/appsettings.json (100%) rename {TomPIT.Connected => Connected.Host}/sys.json (56%) diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..fc2933b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,226 @@ +# Remove the line below if you want to inherit .editorconfig settings from higher directories +root = true + +# C# files +[*.cs] + +#### Core EditorConfig Options #### + +# Indentation and spacing +indent_size = 4 +indent_style = tab +tab_width = 4 + +# New line preferences +end_of_line = crlf +insert_final_newline = false + +#### .NET Coding Conventions #### + +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = true +file_header_template = unset + +# this. and Me. preferences +dotnet_style_qualification_for_event = false +dotnet_style_qualification_for_field = false +dotnet_style_qualification_for_method = false +dotnet_style_qualification_for_property = false + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true +dotnet_style_predefined_type_for_member_access = true + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity +dotnet_style_parentheses_in_other_operators = never_if_unnecessary +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members + +# Expression-level preferences +dotnet_style_coalesce_expression = true +dotnet_style_collection_initializer = true +dotnet_style_explicit_tuple_names = true +dotnet_style_namespace_match_folder = true +dotnet_style_null_propagation = true +dotnet_style_object_initializer = true +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true +dotnet_style_prefer_compound_assignment = true +dotnet_style_prefer_conditional_expression_over_assignment = true +dotnet_style_prefer_conditional_expression_over_return = true +dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed +dotnet_style_prefer_inferred_anonymous_type_member_names = true +dotnet_style_prefer_inferred_tuple_names = true +dotnet_style_prefer_is_null_check_over_reference_equality_method = true +dotnet_style_prefer_simplified_boolean_expressions = true +dotnet_style_prefer_simplified_interpolation = true + +# Field preferences +dotnet_style_readonly_field = true + +# Parameter preferences +dotnet_code_quality_unused_parameters = all + +# Suppression preferences +dotnet_remove_unnecessary_suppression_exclusions = none + +# New line preferences +dotnet_style_allow_multiple_blank_lines_experimental = false +dotnet_style_allow_statement_immediately_after_block_experimental = false + +#### C# Coding Conventions #### + +# var preferences +csharp_style_var_elsewhere = true +csharp_style_var_for_built_in_types = true +csharp_style_var_when_type_is_apparent = true + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true +csharp_style_expression_bodied_constructors = false +csharp_style_expression_bodied_indexers = true +csharp_style_expression_bodied_lambdas = true +csharp_style_expression_bodied_local_functions = false +csharp_style_expression_bodied_methods = false +csharp_style_expression_bodied_operators = false +csharp_style_expression_bodied_properties = true + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true +csharp_style_pattern_matching_over_is_with_cast_check = true +csharp_style_prefer_extended_property_pattern = true +csharp_style_prefer_not_pattern = true +csharp_style_prefer_pattern_matching = true +csharp_style_prefer_switch_expression = true + +# Null-checking preferences +csharp_style_conditional_delegate_call = true + +# Modifier preferences +csharp_prefer_static_local_function = true +csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async +csharp_style_prefer_readonly_struct = true + +# Code-block preferences +csharp_prefer_braces = when_multiline +csharp_prefer_simple_using_statement = true +csharp_style_namespace_declarations = file_scoped +csharp_style_prefer_method_group_conversion = true +csharp_style_prefer_top_level_statements = true + +# Expression-level preferences +csharp_prefer_simple_default_expression = true +csharp_style_deconstructed_variable_declaration = true +csharp_style_implicit_object_creation_when_type_is_apparent = true +csharp_style_inlined_variable_declaration = true +csharp_style_prefer_index_operator = true +csharp_style_prefer_local_over_anonymous_function = true +csharp_style_prefer_null_check_over_type_check = true +csharp_style_prefer_range_operator = true +csharp_style_prefer_tuple_swap = true +csharp_style_prefer_utf8_string_literals = true +csharp_style_throw_expression = true +csharp_style_unused_value_assignment_preference = discard_variable +csharp_style_unused_value_expression_statement_preference = discard_variable + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace + +# New line preferences +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false +csharp_style_allow_embedded_statements_on_same_line_experimental = false + +#### C# Formatting Rules #### + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = all +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_labels = one_less_than_current +csharp_indent_switch_labels = true + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# Wrapping preferences +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = false + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case diff --git a/TomPIT.Connected.sln b/Connected.Host.sln similarity index 80% rename from TomPIT.Connected.sln rename to Connected.Host.sln index 4b7954a..ada863f 100644 --- a/TomPIT.Connected.sln +++ b/Connected.Host.sln @@ -3,27 +3,27 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32901.215 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TomPIT.Connected", "TomPIT.Connected\TomPIT.Connected.csproj", "{A2A01D43-0CEE-4E49-8EC1-F16CA92F3C30}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Host", "Connected.Host\Connected.Host.csproj", "{A2A01D43-0CEE-4E49-8EC1-F16CA92F3C30}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dependencies", "Dependencies", "{D875F828-05A0-4A52-9A36-6F5B0370171D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Data", "..\Framework\Connected.Data\Connected.Data.csproj", "{67532F27-3F13-404D-AD65-34317719059D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Data", "..\Connected.Framework\Connected.Data\Connected.Data.csproj", "{67532F27-3F13-404D-AD65-34317719059D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Types", "..\Common.Types\Common.Types\Common.Types.csproj", "{216E4481-92B6-4E52-8877-3C6D547803ED}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Types", "..\Connected.Common.Types\Connected.Common.Types\Connected.Common.Types.csproj", "{216E4481-92B6-4E52-8877-3C6D547803ED}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Rest", "..\Framework\Connected.Rest\Connected.Rest.csproj", "{AD931DF4-9695-4D9A-8E08-8A5041175755}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Rest", "..\Connected.Framework\Connected.Rest\Connected.Rest.csproj", "{AD931DF4-9695-4D9A-8E08-8A5041175755}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Entities", "..\Framework\Connected.Entities\Connected.Entities.csproj", "{DB941857-07B7-4CD0-B43F-32EC51B5F195}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Entities", "..\Connected.Framework\Connected.Entities\Connected.Entities.csproj", "{DB941857-07B7-4CD0-B43F-32EC51B5F195}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Expressions", "..\Framework\Connected.Expressions\Connected.Expressions.csproj", "{6FCD7B5E-A42C-433A-8C2E-5BA412736F99}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Expressions", "..\Connected.Framework\Connected.Expressions\Connected.Expressions.csproj", "{6FCD7B5E-A42C-433A-8C2E-5BA412736F99}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Interop", "..\Framework\Connected.Interop\Connected.Interop.csproj", "{84D0EAE0-724F-421A-BDA2-5DEC2D9A254C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Interop", "..\Connected.Framework\Connected.Interop\Connected.Interop.csproj", "{84D0EAE0-724F-421A-BDA2-5DEC2D9A254C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.ServiceModel.Client.Data", "..\Framework.ServiceModel.Client\Connected.ServiceModel.Client.Data\Connected.ServiceModel.Client.Data.csproj", "{EBBECB6F-C996-41C4-B05A-39309A03839E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.ServiceModel.Client.Data", "..\Connected.Framework.ServiceModel.Client\Connected.ServiceModel.Client.Data\Connected.ServiceModel.Client.Data.csproj", "{EBBECB6F-C996-41C4-B05A-39309A03839E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Instance", "..\Framework\Connected.Instance\Connected.Instance.csproj", "{5312A990-8797-44E2-9BA9-858D51DE3825}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Instance", "..\Connected.Framework\Connected.Instance\Connected.Instance.csproj", "{5312A990-8797-44E2-9BA9-858D51DE3825}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Notes", "..\Common\Common.Notes\Common.Notes.csproj", "{28F99091-B4CB-43BF-A6DF-4D47621420D0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Notes", "..\Connected.Common\Connected.Common.Notes\Connected.Common.Notes.csproj", "{28F99091-B4CB-43BF-A6DF-4D47621420D0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/TomPIT.Connected/Configuration/MicroServiceDescriptor.cs b/Connected.Host/Configuration/MicroServiceDescriptor.cs similarity index 73% rename from TomPIT.Connected/Configuration/MicroServiceDescriptor.cs rename to Connected.Host/Configuration/MicroServiceDescriptor.cs index 90c8108..a376eb2 100644 --- a/TomPIT.Connected/Configuration/MicroServiceDescriptor.cs +++ b/Connected.Host/Configuration/MicroServiceDescriptor.cs @@ -1,4 +1,4 @@ -namespace TomPIT.Connected.Configuration +namespace Connected.Host.Configuration { internal class MicroServiceDescriptor { diff --git a/TomPIT.Connected/Configuration/SysConfiguration.cs b/Connected.Host/Configuration/SysConfiguration.cs similarity index 96% rename from TomPIT.Connected/Configuration/SysConfiguration.cs rename to Connected.Host/Configuration/SysConfiguration.cs index a63f32e..d9de44a 100644 --- a/TomPIT.Connected/Configuration/SysConfiguration.cs +++ b/Connected.Host/Configuration/SysConfiguration.cs @@ -1,4 +1,4 @@ -namespace TomPIT.Connected.Configuration +namespace Connected.Host.Configuration { internal static class SysConfiguration { diff --git a/TomPIT.Connected/TomPIT.Connected.csproj b/Connected.Host/Connected.Host.csproj similarity index 100% rename from TomPIT.Connected/TomPIT.Connected.csproj rename to Connected.Host/Connected.Host.csproj diff --git a/TomPIT.Connected/Program.cs b/Connected.Host/Program.cs similarity index 96% rename from TomPIT.Connected/Program.cs rename to Connected.Host/Program.cs index eedb880..8eaa4fa 100644 --- a/TomPIT.Connected/Program.cs +++ b/Connected.Host/Program.cs @@ -1,7 +1,7 @@ using System.Reflection; -using TomPIT.Connected.Configuration; +using Connected.Host.Configuration; -namespace TomPIT.Connected +namespace Connected.Host { public static class Program { diff --git a/TomPIT.Connected/Properties/launchSettings.json b/Connected.Host/Properties/launchSettings.json similarity index 100% rename from TomPIT.Connected/Properties/launchSettings.json rename to Connected.Host/Properties/launchSettings.json diff --git a/TomPIT.Connected/appsettings.Development.json b/Connected.Host/appsettings.Development.json similarity index 100% rename from TomPIT.Connected/appsettings.Development.json rename to Connected.Host/appsettings.Development.json diff --git a/TomPIT.Connected/appsettings.json b/Connected.Host/appsettings.json similarity index 100% rename from TomPIT.Connected/appsettings.json rename to Connected.Host/appsettings.json diff --git a/TomPIT.Connected/sys.json b/Connected.Host/sys.json similarity index 56% rename from TomPIT.Connected/sys.json rename to Connected.Host/sys.json index 32a009e..828e01a 100644 --- a/TomPIT.Connected/sys.json +++ b/Connected.Host/sys.json @@ -81,47 +81,47 @@ "version": "1.0.0.0" }, { - "name": "Common", + "name": "Connected.Common", "version": "1.0.0.0" }, { - "name": "Common.Model", + "name": "Connected.Common.Model", "version": "1.0.0.0" }, { - "name": "Common.Types", + "name": "Connected.Common.Types", "version": "1.0.0.0" }, { - "name": "Common.Types.Model", + "name": "Connected.Common.Types.Model", "version": "1.0.0.0" }, { - "name": "Logistics.Documents", + "name": "Connected.Logistics.Documents", "version": "1.0.0.0" }, { - "name": "Logistics.Processes.Receive", + "name": "Connected.Logistics.Processes.Receive", "version": "1.0.0.0" }, { - "name": "Contacts.Types", + "name": "Connected.Contacts.Types", "version": "1.0.0.0" }, { - "name": "Logistics.Types", + "name": "Connected.Logistics.Types", "version": "1.0.0.0" }, { - "name": "Logistics.Stock", + "name": "Connected.Logistics.Stock", "version": "1.0.0.0" }, { - "name": "Common.Notes", + "name": "Connected.Common.Notes", "version": "1.0.0.0" }, { - "name": "Common.Notes.Model", + "name": "Connected.Common.Notes.Model", "version": "1.0.0.0" }, { @@ -134,20 +134,20 @@ } ], "locations": [ - "C:\\Solutions\\TomPIT.Connected\\Framework\\Connected.Instance\\bin\\Debug\\net7.0", - "C:\\Solutions\\TomPIT.Connected\\Framework\\Connected.Entities\\bin\\Debug\\net7.0", - "C:\\Solutions\\TomPIT.Connected\\Framework\\Connected.Rest\\bin\\Debug\\net7.0", - "C:\\Solutions\\TomPIT.Connected\\Framework.ServiceModel\\Connected.ServiceModel\\bin\\Debug\\net7.0", - "C:\\Solutions\\TomPIT.Connected\\Common\\Common\\bin\\Debug\\net7.0", - "C:\\Solutions\\TomPIT.Connected\\Common.Types\\Common.Types\\bin\\Debug\\net7.0", - "C:\\Solutions\\TomPIT.Connected\\Common\\Common.Notes\\bin\\Debug\\net7.0", - "C:\\Solutions\\TomPIT.Connected\\Logistics\\Logistics.Processes.Receive\\bin\\Debug\\net7.0", - "C:\\Solutions\\TomPIT.Connected\\Logistics\\Logistics.Documents\\bin\\Debug\\net7.0", - "C:\\Solutions\\TomPIT.Connected\\Logistics\\Logistics.Types\\bin\\Debug\\net7.0", - "C:\\Solutions\\TomPIT.Connected\\Logistics\\Logistics.Stock\\bin\\Debug\\net7.0", - "C:\\Solutions\\TomPIT.Connected\\Customers\\Contacts.Types\\bin\\Debug\\net7.0", - "C:\\Solutions\\TomPIT.Connected\\Framework.ServiceModel.Client\\Connected.ServiceModel.Client\\bin\\Debug\\net7.0", - "C:\\Solutions\\TomPIT.Connected\\Framework.ServiceModel.Client\\Connected.ServiceModel.Client.Data\\bin\\Debug\\net7.0" + "D:\\Connected\\Connected.Framework\\Connected.Instance\\bin\\Debug\\net7.0", + "D:\\Connected\\Connected.Framework\\Connected.Entities\\bin\\Debug\\net7.0", + "D:\\Connected\\Connected.Framework\\Connected.Rest\\bin\\Debug\\net7.0", + "D:\\Connected\\Connected.Framework.ServiceModel\\Connected.ServiceModel\\bin\\Debug\\net7.0", + "D:\\Connected\\Connected.Common\\Connected.Common\\bin\\Debug\\net7.0", + "D:\\Connected\\Connected.Common.Types\\Connected.Common.Types\\bin\\Debug\\net7.0", + "D:\\Connected\\Connected.Common\\Connected.Common.Notes\\bin\\Debug\\net7.0", + "D:\\Connected\\Connected.Logistics\\Connected.Logistics.Processes.Receive\\bin\\Debug\\net7.0", + "D:\\Connected\\Connected.Logistics\\Connected.Logistics.Documents\\bin\\Debug\\net7.0", + "D:\\Connected\\Connected.Logistics\\Connected.Logistics.Types\\bin\\Debug\\net7.0", + "D:\\Connected\\Connected.Logistics\\Connected.Logistics.Stock\\bin\\Debug\\net7.0", + "D:\\Connected\\Connected.Customers\\Connected.Contacts.Types\\bin\\Debug\\net7.0", + "D:\\Connected\\Connected.Framework.ServiceModel.Client\\Connected.ServiceModel.Client\\bin\\Debug\\net7.0", + "D:\\Connected\\Connected.Framework.ServiceModel.Client\\Connected.ServiceModel.Client.Data\\bin\\Debug\\net7.0" ], "start": "Connected.Instance.Start, Connected.Instance" }