Skip to content

Commit 381a064

Browse files
authored
(#173) Move Index attribute to EntityTableData. (#200)
* (#173) Move Index attribute to EntityTableData. Update packages and add breaking change support for Cosmos. * Comment out publish-unit-test-result-action - not working right now
1 parent 6524bc6 commit 381a064

File tree

5 files changed

+30
-26
lines changed

5 files changed

+30
-26
lines changed

.github/workflows/build-library.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ env:
2323
permissions:
2424
pull-requests: write
2525
contents: read
26+
checks: write
2627

2728
jobs:
2829
build:
@@ -104,11 +105,11 @@ jobs:
104105
path: ${{ github.workspace }}/**/TestResults/*.trx
105106
retention-days: 7
106107

107-
- name: Publish test results
108-
uses: EnricoMi/publish-unit-test-result-action@v2.16.1
109-
if: ${{ always() && github.event_name == 'pull_request' }}
110-
with:
111-
files: "${{ github.workspace }}/**/*.trx"
108+
# - name: Publish test results
109+
# uses: EnricoMi/publish-unit-test-result-action@v2.18.0
110+
# if: ${{ always() && github.event_name == 'pull_request' }}
111+
# with:
112+
# files: "${{ github.workspace }}/**/*.trx"
112113

113114
- name: Combine coverage reports
114115
uses: danielpalme/ReportGenerator-GitHub-Action@5.2.4

Directory.Packages.props

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,37 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
55
</PropertyGroup>
6-
<PropertyGroup>
7-
<EFVersion>9.0.0</EFVersion>
8-
</PropertyGroup>
96
<ItemGroup>
107
<PackageVersion Include="AutoMapper" Version="13.0.1" />
118
<PackageVersion Include="Azure.Identity" Version="1.13.1" />
12-
<PackageVersion Include="FluentAssertions" Version="7.0.0" />
9+
<PackageVersion Include="FluentAssertions" Version="7.1.0" />
1310
<PackageVersion Include="FluentAssertions.Web" Version="1.7.0" />
1411
<PackageVersion Include="LiteDB" Version="5.0.21" />
15-
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0" />
16-
<PackageVersion Include="Microsoft.AspNetCore.OData" Version="9.1.2" />
17-
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="$(EFVersion)" />
18-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Cosmos" Version="$(EFVersion)" />
19-
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="$(EFVersion)" />
20-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Proxies" Version="$(EFVersion)" />
21-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="$(EFVersion)" />
22-
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="$(EFVersion)" />
23-
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
24-
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.0" />
25-
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
12+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.1" />
13+
<PackageVersion Include="Microsoft.AspNetCore.OData" Version="9.1.3" />
14+
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.1" />
15+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Cosmos" Version="9.0.1" />
16+
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.1" />
17+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Proxies" Version="9.0.1" />
18+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.1" />
19+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.1" />
20+
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.1" />
21+
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.1" />
22+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.1" />
2623
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
2724
<PackageVersion Include="Microsoft.OData.Core" Version="8.2.3" />
2825
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
2926
<PackageVersion Include="Microsoft.Spatial" Version="8.2.3" />
3027
<PackageVersion Include="NSubstitute" Version="5.3.0" />
3128
<PackageVersion Include="NSwag.AspNetCore" Version="14.2.0" />
32-
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.2" />
29+
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.3" />
3330
<PackageVersion Include="Swashbuckle.AspNetCore" Version="7.2.0" />
34-
<PackageVersion Include="System.Formats.Asn1" Version="9.0.0" />
31+
<PackageVersion Include="System.Formats.Asn1" Version="9.0.1" />
3532
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
3633
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
37-
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
34+
<PackageVersion Include="System.Text.Json" Version="9.0.1" />
3835
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
39-
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="9.0.0" />
36+
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="9.0.1" />
4037
<PackageVersion Include="xunit" Version="2.9.3" />
4138
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.1" />
4239
<PackageVersion Include="coverlet.collector" Version="6.0.3" />

src/CommunityToolkit.Datasync.Server.EntityFrameworkCore/BaseEntityTableData.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using Microsoft.EntityFrameworkCore;
65
using System.ComponentModel.DataAnnotations;
76

87
namespace CommunityToolkit.Datasync.Server.EntityFrameworkCore;
98

109
/// <summary>
1110
/// The base class for all the Entity Framework Core based table data classes.
1211
/// </summary>
13-
[Index(nameof(UpdatedAt), nameof(Deleted))]
1412
public abstract class BaseEntityTableData : ITableData
1513
{
1614
/// <inheritdoc />

src/CommunityToolkit.Datasync.Server.EntityFrameworkCore/EntityTableData.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
using Microsoft.EntityFrameworkCore;
56
using System.ComponentModel.DataAnnotations;
67
using System.ComponentModel.DataAnnotations.Schema;
78

@@ -11,6 +12,7 @@ namespace CommunityToolkit.Datasync.Server.EntityFrameworkCore;
1112
/// A version of the <see cref="BaseEntityTableData"/> that is compatible with
1213
/// most of the Entity Framework Core drivers.
1314
/// </summary>
15+
[Index(nameof(UpdatedAt), nameof(Deleted))]
1416
public class EntityTableData : BaseEntityTableData
1517
{
1618
/// <inheritdoc />

tests/CommunityToolkit.Datasync.TestCommon/Databases/CosmosDb/CosmosDbContext.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
66
using Microsoft.EntityFrameworkCore;
77
using Xunit.Abstractions;
8+
using Microsoft.EntityFrameworkCore.Diagnostics;
89

910
namespace CommunityToolkit.Datasync.TestCommon.Databases;
1011

@@ -34,6 +35,11 @@ internal void InitializeDatabase()
3435
SaveChanges();
3536
}
3637

38+
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
39+
{
40+
optionsBuilder.ConfigureWarnings(w => w.Ignore(CosmosEventId.SyncNotSupported));
41+
}
42+
3743
protected override void OnModelCreating(ModelBuilder modelBuilder)
3844
{
3945
modelBuilder.Entity<CosmosEntityMovie>(builder =>

0 commit comments

Comments
 (0)