Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit 3ead31e

Browse files
authored
Merge pull request #174 from linq2db/version2
Release 2.1.0
2 parents da2efc3 + 91a2ef5 commit 3ead31e

File tree

198 files changed

+15815
-12579
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+15815
-12579
lines changed

.editorconfig

Lines changed: 260 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,260 @@
1-
; What is EditorConfig? http://editorconfig.org/
2-
3-
root = true
4-
5-
; use tabs identation for all files
6-
[*]
7-
indent_style = tab
8-
insert_final_newline = true
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = tab
7+
indent_size = 4
8+
insert_final_newline = true
9+
end_of_line = crlf
10+
11+
# Code files
12+
[*.{cs,csx,vb,vbx}]
13+
charset = utf-8-bom
14+
15+
# XML project files
16+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
17+
18+
# XML config files
19+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
20+
21+
# JSON files
22+
[*.json]
23+
24+
# Powershell files
25+
[*.ps1]
26+
27+
# Azure files
28+
[*.{yml,sh,cmd,md}]
29+
indent_style = space
30+
31+
# Azure files
32+
[*.sh]
33+
end_of_line = lf
34+
35+
36+
# Dotnet code style settings:
37+
[*.{cs,vb}]
38+
39+
# Sort using and Import directives with System.* appearing first
40+
dotnet_sort_system_directives_first = true
41+
dotnet_separate_import_directive_groups = false
42+
43+
# Use language keywords instead of framework type names for type references
44+
dotnet_style_predefined_type_for_locals_parameters_members = true:error
45+
dotnet_style_predefined_type_for_member_access = true:suggestion
46+
47+
# Suggest more modern language features when available
48+
dotnet_style_object_initializer = true:suggestion
49+
dotnet_style_collection_initializer = true:suggestion
50+
dotnet_style_coalesce_expression = true:suggestion
51+
dotnet_style_null_propagation = true:suggestion
52+
dotnet_style_explicit_tuple_names = true:suggestion
53+
54+
# CSharp code style settings:
55+
[*.cs]
56+
# Newline settings
57+
csharp_new_line_before_open_brace = all
58+
csharp_new_line_before_else = true
59+
csharp_new_line_before_catch = true
60+
csharp_new_line_before_finally = true
61+
csharp_new_line_before_members_in_object_initializers = true
62+
csharp_new_line_before_members_in_anonymous_types = true
63+
csharp_new_line_between_query_expression_clauses = true
64+
65+
# Indentation preferences
66+
csharp_indent_block_contents = true
67+
csharp_indent_braces = false
68+
csharp_indent_case_contents = true
69+
csharp_indent_case_contents_when_block = false
70+
csharp_indent_switch_labels = true
71+
csharp_indent_labels = flush_left
72+
73+
# Spacing options
74+
csharp_space_around_declaration_statements = ignore
75+
76+
# Prefer "var" everywhere
77+
csharp_style_var_for_built_in_types = true:suggestion
78+
csharp_style_var_when_type_is_apparent = true:suggestion
79+
csharp_style_var_elsewhere = true:suggestion
80+
81+
# Prefer method-like constructs to have a block body
82+
csharp_style_expression_bodied_methods = false:none
83+
csharp_style_expression_bodied_constructors = false:none
84+
csharp_style_expression_bodied_operators = false:none
85+
86+
# Prefer property-like constructs to have an expression-body
87+
csharp_style_expression_bodied_properties = true:warning
88+
csharp_style_expression_bodied_indexers = true:warning
89+
csharp_style_expression_bodied_accessors = true:warning
90+
91+
# Suggest more modern language features when available
92+
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
93+
csharp_style_pattern_matching_over_as_with_null_check = true:warning
94+
csharp_style_inlined_variable_declaration = true:suggestion
95+
csharp_style_throw_expression = true:suggestion
96+
csharp_style_conditional_delegate_call = true:suggestion
97+
98+
# Blocks are allowed
99+
csharp_prefer_braces = true:silent
100+
csharp_preserve_single_line_blocks = true
101+
csharp_preserve_single_line_statements = true
102+
103+
csharp_prefer_simple_using_statement = false:silent
104+
csharp_style_prefer_switch_expression = true:warning
105+
106+
dotnet_style_prefer_compound_assignment = true:warning
107+
108+
[*.{cs,vb}]
109+
#############
110+
# Analyzers #
111+
#############
112+
113+
# general settings applied to all source files
114+
# Source folder contains additional .editorconfig with overrides
115+
#
116+
# enable all analyzers by default
117+
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/
118+
dotnet_analyzer_diagnostic.severity = error
119+
dotnet_code_quality.api_surface = all
120+
dotnet_code_quality.enable_platform_analyzer_on_pre_net5_target = true
121+
122+
##############################################
123+
# active diagnostics (explicitly configured) #
124+
##############################################
125+
126+
dotnet_diagnostic.CA1825.severity = error # CA1825: Avoid zero-length array allocations
127+
# generates a lot of noise in tests, enabled in source .editorconfig
128+
dotnet_diagnostic.CA2007.severity = none # CA2007: Do not directly await a Task
129+
dotnet_diagnostic.CA2012.severity = error # CA2012: Use ValueTasks correctly
130+
dotnet_diagnostic.CA2016.severity = error # CA2016: Forward the CancellationToken parameter to methods that take one
131+
dotnet_diagnostic.CA1018.severity = error # CA1018: Mark attributes with AttributeUsageAttribute
132+
dotnet_diagnostic.CA1200.severity = error # CA1200: Avoid using cref tags with a prefix
133+
dotnet_diagnostic.CA1507.severity = error # CA1507: Use nameof in place of string
134+
dotnet_diagnostic.CA1725.severity = error # CA1725: Parameter names should match base declaration
135+
dotnet_diagnostic.CA1805.severity = error # CA1805: Do not initialize unnecessarily
136+
# not interested
137+
dotnet_diagnostic.CA1816.severity = none # CA1816: Call GC.SuppressFinalize correctly
138+
dotnet_diagnostic.CA1826.severity = error # CA1826: Use property instead of Linq Enumerable method
139+
# reported for valid test linq code, rule enabled in source .editorconfig
140+
dotnet_diagnostic.CA1827.severity = none # CA1827: Do not use Count/LongCount when Any can be used
141+
# reported for valid test linq code, rule enabled in source .editorconfig
142+
dotnet_diagnostic.CA1829.severity = none # CA1829: Use Length/Count property instead of Enumerable.Count method
143+
dotnet_diagnostic.CA1830.severity = error # CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder
144+
dotnet_diagnostic.CA1834.severity = error # CA1834: Use StringBuilder.Append(char) for single character strings
145+
dotnet_diagnostic.CA1836.severity = error # CA1836: Prefer IsEmpty over Count when available
146+
dotnet_diagnostic.CA2101.severity = error # CA2101: Specify marshaling for P/Invoke string arguments
147+
dotnet_diagnostic.CA2200.severity = error # CA2200: Rethrow to preserve stack details
148+
dotnet_diagnostic.CA2201.severity = error # CA2201: Do not raise reserved exception types
149+
dotnet_diagnostic.CA2208.severity = error # CA2208: Instantiate argument exceptions correctly
150+
dotnet_diagnostic.CA2215.severity = error # CA2215: Dispose methods should call base class dispose
151+
# not interested
152+
dotnet_diagnostic.CA2231.severity = none # CA2231: Overload operator equals on overriding ValueType.Equals
153+
# disabled, as NETFX doesn't have string.Contains overloads with comparison type
154+
dotnet_diagnostic.CA2249.severity = none # CA2249: Consider using String.Contains instead of String.IndexOf
155+
dotnet_diagnostic.CA3075.severity = error # CA3075: Insecure DTD Processing
156+
# very slow (https://github.com/dotnet/roslyn-analyzers/issues/4754)
157+
# also we don't have code that could be targeted by it
158+
dotnet_diagnostic.CA3076.severity = none # CA3076: Insecure XSLT Script Execution
159+
160+
#########################################################################################################
161+
# inactive diagnostics (not reviewed yet => disabled to not fail build, basically TODO list for future) #
162+
#########################################################################################################
163+
dotnet_diagnostic.CA1000.severity = none # CA1000: Do not declare static members on generic types
164+
dotnet_diagnostic.CA1001.severity = none # CA1001: Types that own disposable fields should be disposable
165+
dotnet_diagnostic.CA1010.severity = none # CA1010: Collections should implement generic interface
166+
dotnet_diagnostic.CA1050.severity = none # CA1050: Declare types in namespaces
167+
dotnet_diagnostic.CA1036.severity = none # CA1036: Override methods on comparable types
168+
dotnet_diagnostic.CA1051.severity = none # CA1051: Do not declare visible instance fields
169+
dotnet_diagnostic.CA1067.severity = none # CA1067: Override Equals when implementing IEquatable
170+
dotnet_diagnostic.CA1068.severity = none # CA1068: CancellationToken parameters must come last
171+
dotnet_diagnostic.CA1069.severity = none # CA1069: Enums should not have duplicate values
172+
dotnet_diagnostic.CA1304.severity = none # CA1304: Specify CultureInfo
173+
dotnet_diagnostic.CA1305.severity = none # CA1305: Specify IFormatProvider
174+
dotnet_diagnostic.CA1309.severity = none # CA1309: Use ordinal StringComparison
175+
dotnet_diagnostic.CA1310.severity = none # CA1310: Specify StringComparison for correctness
176+
dotnet_diagnostic.CA1707.severity = none # CA1707: Identifiers should not contain underscores
177+
dotnet_diagnostic.CA1708.severity = none # CA1708: Identifiers should differ by more than case
178+
dotnet_diagnostic.CA1711.severity = none # CA1711: Identifiers should not have incorrect suffix
179+
dotnet_diagnostic.CA1715.severity = none # CA1715: Identifiers should have correct prefix
180+
dotnet_diagnostic.CA1716.severity = none # CA1716: Identifiers should not match keywords
181+
dotnet_diagnostic.CA1720.severity = none # CA1720: Identifiers should not contain type names
182+
dotnet_diagnostic.CA1806.severity = none # CA1806: Do not ignore method results
183+
dotnet_diagnostic.CA1822.severity = none # CA1822: Mark members as static
184+
dotnet_diagnostic.CA2211.severity = none # CA2211: Non-constant fields should not be visible
185+
186+
###################################################################################
187+
# VS analyzers #
188+
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ #
189+
###################################################################################
190+
dotnet_diagnostic.IDE0001.severity = error # IDE0001: Simplify name
191+
dotnet_diagnostic.IDE0002.severity = error # IDE0002: Simplify member access
192+
193+
# IDE0003: Remove this or Me qualification
194+
# IDE0009: Add this or Me qualification
195+
dotnet_diagnostic.IDE0003.severity = error
196+
dotnet_style_qualification_for_field = false:refactoring
197+
dotnet_style_qualification_for_property = false:refactoring
198+
dotnet_style_qualification_for_method = false:refactoring
199+
dotnet_style_qualification_for_event = false:refactoring
200+
201+
dotnet_diagnostic.IDE0004.severity = error # IDE0004: Remove unnecessary cast
202+
dotnet_diagnostic.IDE0005.severity = error # IDE0005: Remove unnecessary import
203+
204+
# not reviewed yet rules
205+
dotnet_diagnostic.IDE0007.severity = none # IDE0007: Use 'var' instead of explicit type
206+
dotnet_diagnostic.IDE0010.severity = none # IDE0010: Add missing cases to switch statement
207+
dotnet_diagnostic.IDE0011.severity = none # IDE0011: Add braces
208+
dotnet_diagnostic.IDE0016.severity = none # IDE0016: Use throw expression
209+
dotnet_diagnostic.IDE0017.severity = none # IDE0017: Use object initializers
210+
dotnet_diagnostic.IDE0018.severity = none # IDE0018: Inline variable declaration
211+
dotnet_diagnostic.IDE0019.severity = none # IDE0019: Use pattern matching to avoid 'as' followed by a 'null' check
212+
dotnet_diagnostic.IDE0025.severity = none # IDE0025: Use expression body for properties
213+
dotnet_diagnostic.IDE0026.severity = none # IDE0026: Use expression body for indexers
214+
dotnet_diagnostic.IDE0027.severity = none # IDE0027: Use expression body for accessors
215+
dotnet_diagnostic.IDE0028.severity = none # IDE0028: Use collection initializers
216+
dotnet_diagnostic.IDE0029.severity = none # IDE0029: Use coalesce expression (non-nullable types)
217+
dotnet_diagnostic.IDE0030.severity = none # IDE0030: Use coalesce expression
218+
dotnet_diagnostic.IDE0031.severity = none # IDE0031: Use null propagation
219+
dotnet_diagnostic.IDE0032.severity = none # IDE0032: Use auto property
220+
dotnet_diagnostic.IDE0034.severity = none # IDE0034: Simplify 'default' expression
221+
dotnet_diagnostic.IDE0036.severity = none # IDE0036: Order modifiers
222+
dotnet_diagnostic.IDE0037.severity = none # IDE0037: Use inferred member name
223+
dotnet_diagnostic.IDE0038.severity = none # IDE0038: Use pattern matching to avoid 'is' check followed by a cast
224+
dotnet_diagnostic.IDE0040.severity = none # IDE0040: Add accessibility modifiers
225+
dotnet_diagnostic.IDE0041.severity = none # IDE0041: Use is null check
226+
dotnet_diagnostic.IDE0044.severity = none # IDE0044: Add readonly modifier
227+
dotnet_diagnostic.IDE0045.severity = none # IDE0045: Use conditional expression for assignment
228+
dotnet_diagnostic.IDE0046.severity = none # IDE0046: Convert to conditional expression
229+
dotnet_diagnostic.IDE0047.severity = none # IDE0047: Remove unnecessary parentheses
230+
dotnet_diagnostic.IDE0048.severity = none # IDE0048: Add parentheses for clarity
231+
dotnet_diagnostic.IDE0049.severity = none # IDE0049: Use language keywords instead of framework type names for type references
232+
dotnet_diagnostic.IDE0050.severity = none # IDE0050: Convert to tuple
233+
dotnet_diagnostic.IDE0051.severity = none # IDE0051: Remove unused private members
234+
dotnet_diagnostic.IDE0052.severity = none # IDE0052: Remove unread private member
235+
dotnet_diagnostic.IDE0054.severity = none # IDE0054: Use compound assignment
236+
dotnet_diagnostic.IDE0055.severity = none # IDE0055: Formatting rules
237+
dotnet_diagnostic.IDE0056.severity = none # IDE0056: Use index operator
238+
dotnet_diagnostic.IDE0057.severity = none # IDE0057: Use range operator
239+
dotnet_diagnostic.IDE0058.severity = none # IDE0058: computed value is never used
240+
dotnet_diagnostic.IDE0059.severity = none # IDE0059: Remove unnecessary value assignment
241+
dotnet_diagnostic.IDE0060.severity = none # IDE0060: Remove unused parameter
242+
dotnet_diagnostic.IDE0061.severity = none # IDE0061: Use expression body for local functions
243+
dotnet_diagnostic.IDE0062.severity = none # IDE0062: Make local function static
244+
dotnet_diagnostic.IDE0065.severity = none # IDE0065: Misplaced using directive
245+
dotnet_diagnostic.IDE0066.severity = none # IDE0066: Convert switch statement to expression
246+
dotnet_diagnostic.IDE0070.severity = none # IDE0070: Use 'System.HashCode.Combine'
247+
dotnet_diagnostic.IDE0072.severity = none # IDE0072: Add missing cases
248+
dotnet_diagnostic.IDE0075.severity = none # IDE0075: Simplify conditional expression
249+
dotnet_diagnostic.IDE0078.severity = none # IDE0078: Use pattern matching
250+
dotnet_diagnostic.IDE0079.severity = none # IDE0079: Remove unnecessary suppression
251+
dotnet_diagnostic.IDE0080.severity = none # IDE0080: Remove unnecessary suppression operator
252+
dotnet_diagnostic.IDE0081.severity = none # IDE0081: Remove ByVal
253+
dotnet_diagnostic.IDE0083.severity = none # IDE0083: Use pattern matching (not operator)
254+
dotnet_diagnostic.IDE1006.severity = none # IDE1006: Naming rule violation
255+
256+
dotnet_diagnostic.CS1998.severity = error # CS1998: Async method lacks 'await' operators and will run synchronously
257+
dotnet_diagnostic.CS8618.severity = error # CS8618: Non-nullable field is uninitialized. Consider declaring as nullable.
258+
dotnet_diagnostic.CS4014.severity = error # CS4014: Because this call is not awaited, execution of the current method continues before the call is completed
259+
260+
#

Build/linq2db.Default.props

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>2.0.6</Version>
3+
<Version>2.1.0</Version>
44

5-
<Description>Allows to execute Linq to DB (linq2db) queries in Entity Framework Core DbContext.</Description>
6-
<Title>Linq to DB (linq2db) extensions for Entity Framework Core</Title>
7-
<AssemblyTitle>$(Title)</AssemblyTitle>
85
<Authors>Svyatoslav Danyliv, Igor Tkachev, Dmitry Lukashenko, Ilya Chudin</Authors>
96
<Product>Linq to DB</Product>
107
<Company>linq2db.net</Company>
11-
<Copyright>2002-2020 linq2db.net</Copyright>
8+
<Copyright>2002-2021 linq2db.net</Copyright>
129
<RepositoryUrl>https://github.com/linq2db/linq2db.EntityFrameworkCore</RepositoryUrl>
1310
<RepositoryType>git</RepositoryType>
1411

15-
<AppDesignerFolder>Properties</AppDesignerFolder>
16-
<LangVersion>8.0</LangVersion>
17-
<Nullable>disable</Nullable>
12+
<LangVersion>latest</LangVersion>
13+
<Nullable>enable</Nullable>
1814
<WarningLevel>4</WarningLevel>
1915
<ErrorReport>prompt</ErrorReport>
20-
<NoWarn>1701;1591</NoWarn>
2116

2217
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
2318
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
@@ -32,5 +27,13 @@
3227
<GenerateAssemblyVersionAttribute>true</GenerateAssemblyVersionAttribute>
3328
<GenerateAssemblyFileVersionAttribute>true</GenerateAssemblyFileVersionAttribute>
3429
<GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
30+
31+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
32+
</PropertyGroup>
33+
34+
<PropertyGroup>
35+
<AnalysisLevel>preview</AnalysisLevel>
36+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
37+
<RunAnalyzers>true</RunAnalyzers>
3538
</PropertyGroup>
3639
</Project>

Build/linq2db.Tests.props

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project>
2+
<Import Project="linq2db.Default.props" />
3+
4+
<PropertyGroup>
5+
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
10+
<PackageReference Include="NUnit3TestAdapter">
11+
<PrivateAssets>all</PrivateAssets>
12+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
13+
</PackageReference>
14+
<PackageReference Include="NUnit" />
15+
</ItemGroup>
16+
17+
</Project>

Directory.Packages.props

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Project>
2+
<ItemGroup>
3+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
4+
<PackageVersion Include="NUnit3TestAdapter" Version="4.0.0" />
5+
<PackageVersion Include="NUnit" Version="3.13.2" />
6+
<PackageVersion Include="FluentAssertions" Version="5.10.3" />
7+
8+
<PackageVersion Include="linq2db" Version="3.4.4" />
9+
<PackageVersion Include="linq2db.Tools" Version="3.4.4" />
10+
11+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.0.0" />
12+
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />
13+
<PackageVersion Include="System.Interactive.Async" Version="3.2.0"/>
14+
15+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="2.2.6" />
16+
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.2.6" />
17+
18+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="5.0.0" />
19+
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
20+
21+
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.6" />
22+
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.4" />
23+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
24+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.6" />
25+
</ItemGroup>
26+
</Project>

NuGet.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<configuration>
33
<packageSources>
44
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
5-
<add key="linq2db" value="https://www.myget.org/F/linq2db/api/v3/index.json" />
5+
<add key="linq2db" value="https://pkgs.dev.azure.com/linq2db/linq2db/_packaging/linq2db/nuget/v3/index.json" />
66
</packageSources>
77
</configuration>

0 commit comments

Comments
 (0)