Skip to content

Commit 1b60096

Browse files
authored
V3.5.0 (#78)
* Bulk Json, Mapping, OData and DataVerse enhancements. * Finalize ODataQuery, * Enable `WebApiPublisher.Mapper` support for greater flexibility. * Fix breaking change for JsonFilterer method signature. * Enhance doco.
1 parent a360dec commit 1b60096

File tree

71 files changed

+5537
-260
lines changed

Some content is hidden

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

71 files changed

+5537
-260
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
Represents the **NuGet** versions.
44

5+
## v3.5.0
6+
- *Enhancement:* Update the `JsonFilterer` classes to support qualified (indexed) property names; all paths are standardized with the `$` prefix internally.
7+
- *Enhancement:* Added `JsonNode` extension methods `ApplyInclude` and `ApplyExclude` to simplify corresponding `JsonFilterer` usage.
8+
- *Enhancement:* Added `JsonElementComparer` to compare two `JsonElement` values (and typed values) and return the differences (`JsonElementComparerResult`). Additionally, the `JsonElementComparerResult.ToMergePatch` will create a corresponding `JsonNode` that represents an `application/merge-patch+json` representation of the differences.
9+
- *Enhancement:* Added `DateTimeToStringConverter` to enable the explicit formatting of a `DateTime` to a `string` and vice-versa.
10+
- *Enhancement:* Added `JsonObjectMapper` to enable explicit mapping of a `Type` (class) to a `JsonObject` and vice-versa (versus serialization). This enables property conversion, mapping and operation types to be specified, similar to other _CoreEx_ mapping capabilities.
11+
- *Enhancement:* Renamed `WebApiPublisher.PublishAsync<TColl, TItem>` to `WebApiPublisher.PublishCollectionAsync<TColl, TItem>` to be more explicit with respect to purpose and usage.
12+
- *Enhancement:* The `WebApiPublisher.PublishAsync` has had the `eventModifier` delegate parameter simplified to no longer include a value as this is already available via the `Value` property of the existing `EventData` parameter.
13+
- *Enhancement:* Added additional overloads to `WebApiPublisher.PublishAsync` and `WebApiPublisher.PublishCollectionAsync` to support the event publishing of a different (mapped) type where applicable; see `eventModifier` delegate parameter. Additionally, supports `WebApiPublisher.Mapper` to convert/map by default where applicable.
14+
- *Fixed:* The `Result.OnFailure*` methods corrected to pass in the `Error` versus the `Value` (previously throwing incorrect exception as a result).
15+
- *Enhancement:* Added new `CoreEx.OData` project/package to support [OData](https://learn.microsoft.com/en-us/odata/overview) capabilities. Primarily encapsulates the open-source [`Simple.OData.Client`](https://github.com/simple-odata-client/Simple.OData.Client).
16+
- _Note:_ this package has not been published as this is currently considered experimental; is subject to future change and/or removal.
17+
- *Enhancement:* Added new `CoreEx.Dataverse` project/package to support [Microsoft Dataverse](https://docs.microsoft.com/en-us/powerapps/developer/data-platform/choose-data-platform) (formerly known as Common Data Service or CDS) capabilities. Primarily encapsulates the [`ServiceClient`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.powerplatform.dataverse.client.serviceclient) and mappings to/from the _Dataverse_ entities.
18+
- _Note:_ this package has not been published as this is currently considered experimental; is subject to future change and/or removal.
19+
520
## v3.4.1
621
- *Fixed:* The `IEfDb.With` fixed (as extension methods) to also support the `with` value being passed into the corresponding `Action<T>` to simplify usage (only a subset of common intrinsic types supported, both nullable and non-nullable overloads).
722
- *Fixed:* Missing `Result.CacheSet` and `Result.CacheRemove` extension methods added to `CoreEx.Results` to fully enable `IRequestCaching` in addition to existing `Result.CacheGetOrAddAsync`.

CONTRIBUTING.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,17 @@ The most general guideline is that we use all the VS default settings in terms o
3434
5. Open-braces (`{`) go on a new line (an `if` with single-line statement does not need braces).
3535
6. Use any language features available to you (expression-bodied members, throw expressions, tuples, etc.) as long as they make for readable, manageable code.
3636
7. All methods and properties must include the [XML documentation comments](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/xml-documentation-comments). Private methods and properties only need to specifiy the [summary](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/summary) as a minimum.
37-
8. Breaking changes should be avoided where possible; however, to minimize lifetime costs they are acceptable where change has minimal impact (also avoid alternatives unless additive to minimize codebase bloat). For the most part be guided by [Semantic Versioning 2.0.0](https://semver.org/).
37+
8. Breaking changes should be avoided where possible; however, to minimize lifetime costs (technical debt) they are acceptable where change is expected to have a minimal impact (also avoid alternatives unless additive to minimize codebase bloat). For the most part be guided by [Semantic Versioning 2.0.0](https://semver.org/).
3838

3939
For further guidance see ASP.NET Core [Engineering guidelines](https://github.com/aspnet/AspNetCore/wiki/Engineering-guidelines).
4040

41+
Additionally, all source code files (`/src/**/*.cs`) require this exact header as follows:
42+
43+
``` csharp
44+
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/CoreEx
45+
```
46+
47+
4148
<br/>
4249

4350
## Tests

Common.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>3.4.1</Version>
3+
<Version>3.5.0</Version>
44
<LangVersion>preview</LangVersion>
55
<Authors>Avanade</Authors>
66
<Company>Avanade</Company>

CoreEx.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreEx.Solace.Test", "tests
7979
EndProject
8080
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreEx.AspNetCore", "src\CoreEx.AspNetCore\CoreEx.AspNetCore.csproj", "{804FFA4D-D530-46A7-9ECD-D2D42987161E}"
8181
EndProject
82+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreEx.Dataverse", "src\CoreEx.Dataverse\CoreEx.Dataverse.csproj", "{E7CF0E06-BDC3-49E5-AC52-D65894ED6AFF}"
83+
EndProject
84+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreEx.OData", "src\CoreEx.OData\CoreEx.OData.csproj", "{2A31E887-0340-47D2-AF80-D88D2866C80E}"
85+
EndProject
8286
Global
8387
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8488
Debug|Any CPU = Debug|Any CPU
@@ -185,6 +189,14 @@ Global
185189
{804FFA4D-D530-46A7-9ECD-D2D42987161E}.Debug|Any CPU.Build.0 = Debug|Any CPU
186190
{804FFA4D-D530-46A7-9ECD-D2D42987161E}.Release|Any CPU.ActiveCfg = Release|Any CPU
187191
{804FFA4D-D530-46A7-9ECD-D2D42987161E}.Release|Any CPU.Build.0 = Release|Any CPU
192+
{E7CF0E06-BDC3-49E5-AC52-D65894ED6AFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
193+
{E7CF0E06-BDC3-49E5-AC52-D65894ED6AFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
194+
{E7CF0E06-BDC3-49E5-AC52-D65894ED6AFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
195+
{E7CF0E06-BDC3-49E5-AC52-D65894ED6AFF}.Release|Any CPU.Build.0 = Release|Any CPU
196+
{2A31E887-0340-47D2-AF80-D88D2866C80E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
197+
{2A31E887-0340-47D2-AF80-D88D2866C80E}.Debug|Any CPU.Build.0 = Debug|Any CPU
198+
{2A31E887-0340-47D2-AF80-D88D2866C80E}.Release|Any CPU.ActiveCfg = Release|Any CPU
199+
{2A31E887-0340-47D2-AF80-D88D2866C80E}.Release|Any CPU.Build.0 = Release|Any CPU
188200
EndGlobalSection
189201
GlobalSection(SolutionProperties) = preSolution
190202
HideSolutionNode = FALSE
@@ -217,6 +229,8 @@ Global
217229
{FB6495D7-931C-4280-9499-69D08A613B54} = {4B6BC31E-93B1-42B0-AE09-AD85AC4DB657}
218230
{B2C31D4A-87EE-4568-859B-DC7E8EA1043D} = {3145DCB9-98FB-4519-BCC0-75A22A252EDC}
219231
{804FFA4D-D530-46A7-9ECD-D2D42987161E} = {4B6BC31E-93B1-42B0-AE09-AD85AC4DB657}
232+
{E7CF0E06-BDC3-49E5-AC52-D65894ED6AFF} = {4B6BC31E-93B1-42B0-AE09-AD85AC4DB657}
233+
{2A31E887-0340-47D2-AF80-D88D2866C80E} = {4B6BC31E-93B1-42B0-AE09-AD85AC4DB657}
220234
EndGlobalSection
221235
GlobalSection(ExtensibilityGlobals) = postSolution
222236
SolutionGuid = {8B4566D2-9B22-4E27-9654-402BDBA6C744}

src/CoreEx.AspNetCore/Abstractions/ReferenceDataOrchestratorExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static Task<ReferenceDataMultiCollection> GetNamedAsync(this ReferenceDat
2828

2929
foreach (var q in requestOptions.Request.Query.Where(x => !string.IsNullOrEmpty(x.Key)))
3030
{
31-
if (string.Compare(q.Key, "names", StringComparison.InvariantCultureIgnoreCase) == 0)
31+
if (string.Compare(q.Key, "names", StringComparison.OrdinalIgnoreCase) == 0)
3232
{
3333
foreach (var v in SplitStringValues(q.Value.Where(x => !string.IsNullOrEmpty(x)).Distinct()!))
3434
{

src/CoreEx.AspNetCore/Http/HttpResultExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static HttpRequest ApplyETag(this HttpRequest httpRequest, string? etag)
6767
// Apply the ETag header.
6868
if (!string.IsNullOrEmpty(etag))
6969
{
70-
if (httpRequest.Method.Equals(HttpMethod.Get.Method, StringComparison.InvariantCultureIgnoreCase) || httpRequest.Method.Equals(HttpMethod.Head.Method, StringComparison.InvariantCultureIgnoreCase))
70+
if (httpRequest.Method.Equals(HttpMethod.Get.Method, StringComparison.OrdinalIgnoreCase) || httpRequest.Method.Equals(HttpMethod.Head.Method, StringComparison.OrdinalIgnoreCase))
7171
httpRequest.Headers.Add(HeaderNames.IfNoneMatch, ETagGenerator.FormatETag(etag));
7272
else
7373
httpRequest.Headers.Add(HeaderNames.IfMatch, ETagGenerator.FormatETag(etag));

0 commit comments

Comments
 (0)