diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 150c8b45df..5e87f135f0 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -1,8 +1,6 @@
# I don't want to read this whole thing I just have a question!!!
-> Note: Please don't file an issue to ask a question.
-
-You'll get faster results by using our official [Gitter channel](https://gitter.im/json-api-dotnet-core/Lobby) or [StackOverflow](https://stackoverflow.com/search?q=jsonapidotnetcore) where the community chimes in with helpful advice if you have questions.
+> You can file an issue to ask a question, but you'll get faster results by using our official [Gitter channel](https://gitter.im/json-api-dotnet-core/Lobby) or [StackOverflow](https://stackoverflow.com/search?q=jsonapidotnetcore) where the community chimes in with helpful advice if you have questions.
# How can I contribute?
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index e0c2388a38..c59acf46d6 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -2,18 +2,18 @@
name: Bug report
about: Create a report to help us improve
title: ''
-labels: ''
+labels: 'bug'
assignees: ''
---
-_Please read our [Contributing Guides](https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/.github/CONTRIBUTING.md) before submitting a bug._
+
#### DESCRIPTION
-_A clear and concise description of what the bug is._
+
#### STEPS TO REPRODUCE
-_Consider to include your code here, such as models, DbContext, controllers, resource services, repositories, resource definitions etc. Please also include the request URL with body (if applicable) and the full exception stack trace (set `options.IncludeExceptionStackTraceInErrors` to `true`) in case of errors._ It may also be helpful to include the produced SQL, which can be made visible in logs by adding this to appsettings.json:
+
1.
2.
3.
#### EXPECTED BEHAVIOR
-_A clear and concise description of what you expected to happen._
+
#### ACTUAL BEHAVIOR
-_A clear and concise description of what happens instead._
+
#### VERSIONS USED
- JsonApiDotNetCore version:
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index f7b806fe50..f629ca472d 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -2,21 +2,21 @@
name: Feature request
about: Suggest an idea for this project
title: ''
-labels: ''
+labels: 'enhancement'
assignees: ''
---
-_Please read our [Contributing Guides](https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/.github/CONTRIBUTING.md) before suggesting an idea._
+
**Is your feature request related to a problem? Please describe.**
-_A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]_
+
**Describe the solution you'd like**
-_A clear and concise description of what you want to happen._
+
**Describe alternatives you've considered**
-_A clear and concise description of any alternative solutions or features you've considered._
+
**Additional context**
-_Add any other context or screenshots about the feature request here._
+
diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md
new file mode 100644
index 0000000000..689f2daa01
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/question.md
@@ -0,0 +1,38 @@
+---
+name: Question
+about: Ask a question
+title: ''
+labels: 'question'
+assignees: ''
+
+---
+
+#### SUMMARY
+
+
+#### DETAILS
+
+
+#### STEPS TO REPRODUCE
+
+
+1.
+2.
+3.
+
+#### VERSIONS USED
+- JsonApiDotNetCore version:
+- ASP.NET Core version:
+- Entity Framework Core version:
+- Database provider:
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 3e23a87e27..1a1c618dd7 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -4,6 +4,6 @@ Closes #{ISSUE_NUMBER}
#### QUALITY CHECKLIST
- [ ] Changes implemented in code
-- [ ] Complies with our [contributing guidelines](./.github/CONTRIBUTING.md)
+- [ ] Complies with our [contributing guidelines](https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/.github/CONTRIBUTING.md)
- [ ] Adapted tests
- [ ] Documentation updated
diff --git a/Directory.Build.props b/Directory.Build.props
index 1ceac951ee..c104cbdd11 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -4,10 +4,10 @@
6.0.*6.0.*6.0.*
- 4.1.*
+ 4.2.*2.14.16.2.*
- 5.0.2
+ 5.0.3$(MSBuildThisFileDirectory)CodingGuidelines.ruleset9999enable
@@ -17,8 +17,8 @@
-
-
+
+
@@ -35,7 +35,7 @@
3.1.2
- 4.17.2
- 17.1.0
+ 4.18.1
+ 17.2.0
diff --git a/JsonApiDotNetCore.sln b/JsonApiDotNetCore.sln
index 78464f8248..95b664c16f 100644
--- a/JsonApiDotNetCore.sln
+++ b/JsonApiDotNetCore.sln
@@ -46,8 +46,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestBuildingBlocks", "test\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore.SourceGenerators", "src\JsonApiDotNetCore.SourceGenerators\JsonApiDotNetCore.SourceGenerators.csproj", "{952C0FDE-AFC8-455C-986F-6CC882ED8953}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceGeneratorDebugger", "test\SourceGeneratorDebugger\SourceGeneratorDebugger.csproj", "{87D066F9-3540-4AC7-A748-134900969EE5}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceGeneratorTests", "test\SourceGeneratorTests\SourceGeneratorTests.csproj", "{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore.Annotations", "src\JsonApiDotNetCore.Annotations\JsonApiDotNetCore.Annotations.csproj", "{83FF097C-C8C6-477B-9FAB-DF99B84978B5}"
@@ -242,18 +240,6 @@ Global
{952C0FDE-AFC8-455C-986F-6CC882ED8953}.Release|x64.Build.0 = Release|Any CPU
{952C0FDE-AFC8-455C-986F-6CC882ED8953}.Release|x86.ActiveCfg = Release|Any CPU
{952C0FDE-AFC8-455C-986F-6CC882ED8953}.Release|x86.Build.0 = Release|Any CPU
- {87D066F9-3540-4AC7-A748-134900969EE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {87D066F9-3540-4AC7-A748-134900969EE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {87D066F9-3540-4AC7-A748-134900969EE5}.Debug|x64.ActiveCfg = Debug|Any CPU
- {87D066F9-3540-4AC7-A748-134900969EE5}.Debug|x64.Build.0 = Debug|Any CPU
- {87D066F9-3540-4AC7-A748-134900969EE5}.Debug|x86.ActiveCfg = Debug|Any CPU
- {87D066F9-3540-4AC7-A748-134900969EE5}.Debug|x86.Build.0 = Debug|Any CPU
- {87D066F9-3540-4AC7-A748-134900969EE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {87D066F9-3540-4AC7-A748-134900969EE5}.Release|Any CPU.Build.0 = Release|Any CPU
- {87D066F9-3540-4AC7-A748-134900969EE5}.Release|x64.ActiveCfg = Release|Any CPU
- {87D066F9-3540-4AC7-A748-134900969EE5}.Release|x64.Build.0 = Release|Any CPU
- {87D066F9-3540-4AC7-A748-134900969EE5}.Release|x86.ActiveCfg = Release|Any CPU
- {87D066F9-3540-4AC7-A748-134900969EE5}.Release|x86.Build.0 = Release|Any CPU
{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -369,7 +355,6 @@ Global
{EC3202C6-1D4C-4B14-A599-B9D3F27FE3BA} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
{210FD61E-FF5D-4CEE-8E0D-C739ECCCBA21} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
{952C0FDE-AFC8-455C-986F-6CC882ED8953} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF}
- {87D066F9-3540-4AC7-A748-134900969EE5} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
{83FF097C-C8C6-477B-9FAB-DF99B84978B5} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF}
{60334658-BE51-43B3-9C4D-F2BBF56C89CE} = {026FBC6C-AF76-4568-9B87-EC73457899FD}
diff --git a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceAttribute.cs b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceAttribute.cs
index ca517e3e99..72669de585 100644
--- a/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceAttribute.cs
+++ b/src/JsonApiDotNetCore.Annotations/Resources/Annotations/ResourceAttribute.cs
@@ -1,9 +1,6 @@
using JetBrains.Annotations;
using JsonApiDotNetCore.Controllers;
-// ReSharper disable CheckNamespace
-#pragma warning disable AV1505 // Namespace should match with assembly name
-
namespace JsonApiDotNetCore.Resources.Annotations;
///
diff --git a/src/JsonApiDotNetCore.SourceGenerators/ControllerSourceGenerator.cs b/src/JsonApiDotNetCore.SourceGenerators/ControllerSourceGenerator.cs
index 6728fd537c..65800bba82 100644
--- a/src/JsonApiDotNetCore.SourceGenerators/ControllerSourceGenerator.cs
+++ b/src/JsonApiDotNetCore.SourceGenerators/ControllerSourceGenerator.cs
@@ -13,6 +13,12 @@
namespace JsonApiDotNetCore.SourceGenerators
{
+ // To debug in Visual Studio (requires v17.2 or higher):
+ // - Set JsonApiDotNetCore.SourceGenerators as startup project
+ // - Add a breakpoint at the start of the Initialize or Execute method
+ // - Optional: change targetProject in Properties\launchSettings.json
+ // - Press F5
+
[Generator(LanguageNames.CSharp)]
public sealed class ControllerSourceGenerator : ISourceGenerator
{
diff --git a/src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj b/src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj
index 9f7c0b85dd..bcd8c06b0a 100644
--- a/src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj
+++ b/src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj
@@ -48,6 +48,6 @@
-
+
diff --git a/src/JsonApiDotNetCore.SourceGenerators/Properties/launchSettings.json b/src/JsonApiDotNetCore.SourceGenerators/Properties/launchSettings.json
index 2679b059a9..03635841ec 100644
--- a/src/JsonApiDotNetCore.SourceGenerators/Properties/launchSettings.json
+++ b/src/JsonApiDotNetCore.SourceGenerators/Properties/launchSettings.json
@@ -2,7 +2,7 @@
"profiles": {
"JsonApiDotNetCore.SourceGenerators": {
"commandName": "DebugRoslynComponent",
- "targetProject": "..\\..\\test\\SourceGeneratorDebugger\\SourceGeneratorDebugger.csproj"
+ "targetProject": "..\\Examples\\JsonApiDotNetCoreExample\\JsonApiDotNetCoreExample.csproj"
}
}
}
diff --git a/src/JsonApiDotNetCore/Configuration/ServiceCollectionExtensions.cs b/src/JsonApiDotNetCore/Configuration/ServiceCollectionExtensions.cs
index 8e5d15a7c4..8b5356fdef 100644
--- a/src/JsonApiDotNetCore/Configuration/ServiceCollectionExtensions.cs
+++ b/src/JsonApiDotNetCore/Configuration/ServiceCollectionExtensions.cs
@@ -6,8 +6,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
-#pragma warning disable AV1130 // Return type in method signature should be an interface to an unchangeable collection
-
namespace JsonApiDotNetCore.Configuration;
[PublicAPI]
diff --git a/src/JsonApiDotNetCore/Diagnostics/CascadingCodeTimer.cs b/src/JsonApiDotNetCore/Diagnostics/CascadingCodeTimer.cs
index 44cc2955d9..a2aa7a379b 100644
--- a/src/JsonApiDotNetCore/Diagnostics/CascadingCodeTimer.cs
+++ b/src/JsonApiDotNetCore/Diagnostics/CascadingCodeTimer.cs
@@ -18,7 +18,7 @@ static CascadingCodeTimer()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
- // Be default, measurements using Stopwatch can differ 25%-30% on the same function on the same computer.
+ // By default, measurements using Stopwatch can differ 25%-30% on the same function on the same computer.
// The steps below ensure to get an accuracy of 0.1%-0.2%. With this accuracy, algorithms can be tested and compared.
// https://www.codeproject.com/Articles/61964/Performance-Tests-Precise-Run-Time-Measurements-wi
diff --git a/src/JsonApiDotNetCore/Queries/Expressions/QueryableHandlerExpression.cs b/src/JsonApiDotNetCore/Queries/Expressions/QueryableHandlerExpression.cs
index 4cd035ba2d..1d9c910955 100644
--- a/src/JsonApiDotNetCore/Queries/Expressions/QueryableHandlerExpression.cs
+++ b/src/JsonApiDotNetCore/Queries/Expressions/QueryableHandlerExpression.cs
@@ -21,10 +21,8 @@ public QueryableHandlerExpression(object queryableHandler, StringValues paramete
_parameterValue = parameterValue;
}
-#pragma warning disable AV1130 // Return type in method signature should be an interface to an unchangeable collection
public IQueryable Apply(IQueryable query)
where TResource : class, IIdentifiable
-#pragma warning restore AV1130 // Return type in method signature should be an interface to an unchangeable collection
{
var handler = (Func, StringValues, IQueryable>)_queryableHandler;
return handler(query, _parameterValue);
diff --git a/src/JsonApiDotNetCore/Repositories/EntityFrameworkCoreRepository.cs b/src/JsonApiDotNetCore/Repositories/EntityFrameworkCoreRepository.cs
index 7384cec693..358f63a2cd 100644
--- a/src/JsonApiDotNetCore/Repositories/EntityFrameworkCoreRepository.cs
+++ b/src/JsonApiDotNetCore/Repositories/EntityFrameworkCoreRepository.cs
@@ -105,9 +105,7 @@ public virtual async Task CountAsync(FilterExpression? filter, Cancellation
}
}
-#pragma warning disable AV1130 // Return type in method signature should be an interface to an unchangeable collection
protected virtual IQueryable ApplyQueryLayer(QueryLayer queryLayer)
-#pragma warning restore AV1130 // Return type in method signature should be an interface to an unchangeable collection
{
_traceWriter.LogMethodStart(new
{
@@ -151,9 +149,7 @@ protected virtual IQueryable ApplyQueryLayer(QueryLayer queryLayer)
}
}
-#pragma warning disable AV1130 // Return type in method signature should be an interface to an unchangeable collection
protected virtual IQueryable GetAll()
-#pragma warning restore AV1130 // Return type in method signature should be an interface to an unchangeable collection
{
return _dbContext.Set();
}
diff --git a/src/JsonApiDotNetCore/Resources/SortExpressionLambdaConverter.cs b/src/JsonApiDotNetCore/Resources/SortExpressionLambdaConverter.cs
index a2371419b6..36a6d97aec 100644
--- a/src/JsonApiDotNetCore/Resources/SortExpressionLambdaConverter.cs
+++ b/src/JsonApiDotNetCore/Resources/SortExpressionLambdaConverter.cs
@@ -114,12 +114,9 @@ private static (Expression? innerExpression, bool isCount) TryReadCount(Expressi
private Expression? ReadAttribute(Expression expression)
{
- if (expression is MemberExpression memberExpression)
+ if (expression is MemberExpression { Expression: { } } memberExpression)
{
- ResourceType resourceType = memberExpression.Member.Name == nameof(Identifiable