Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#173) Move Index attribute to EntityTableData. #200

Merged
merged 4 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/build-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
permissions:
pull-requests: write
contents: read
checks: write

jobs:
build:
Expand Down Expand Up @@ -104,11 +105,11 @@ jobs:
path: ${{ github.workspace }}/**/TestResults/*.trx
retention-days: 7

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

- name: Combine coverage reports
uses: danielpalme/[email protected]
Expand Down
35 changes: 16 additions & 19 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,37 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<PropertyGroup>
<EFVersion>9.0.0</EFVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="AutoMapper" Version="13.0.1" />
<PackageVersion Include="Azure.Identity" Version="1.13.1" />
<PackageVersion Include="FluentAssertions" Version="7.0.0" />
<PackageVersion Include="FluentAssertions" Version="7.1.0" />
<PackageVersion Include="FluentAssertions.Web" Version="1.7.0" />
<PackageVersion Include="LiteDB" Version="5.0.21" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.OData" Version="9.1.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="$(EFVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Cosmos" Version="$(EFVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="$(EFVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Proxies" Version="$(EFVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="$(EFVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="$(EFVersion)" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.1" />
<PackageVersion Include="Microsoft.AspNetCore.OData" Version="9.1.3" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Cosmos" Version="9.0.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Proxies" Version="9.0.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.1" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.1" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Microsoft.OData.Core" Version="8.2.3" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="Microsoft.Spatial" Version="8.2.3" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="NSwag.AspNetCore" Version="14.2.0" />
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.2" />
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.3" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="7.2.0" />
<PackageVersion Include="System.Formats.Asn1" Version="9.0.0" />
<PackageVersion Include="System.Formats.Asn1" Version="9.0.1" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
<PackageVersion Include="System.Text.Json" Version="9.0.1" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="9.0.0" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="9.0.1" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;

namespace CommunityToolkit.Datasync.Server.EntityFrameworkCore;

/// <summary>
/// The base class for all the Entity Framework Core based table data classes.
/// </summary>
[Index(nameof(UpdatedAt), nameof(Deleted))]
public abstract class BaseEntityTableData : ITableData
{
/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

Expand All @@ -11,6 +12,7 @@ namespace CommunityToolkit.Datasync.Server.EntityFrameworkCore;
/// A version of the <see cref="BaseEntityTableData"/> that is compatible with
/// most of the Entity Framework Core drivers.
/// </summary>
[Index(nameof(UpdatedAt), nameof(Deleted))]
public class EntityTableData : BaseEntityTableData
{
/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Microsoft.EntityFrameworkCore;
using Xunit.Abstractions;
using Microsoft.EntityFrameworkCore.Diagnostics;

namespace CommunityToolkit.Datasync.TestCommon.Databases;

Expand Down Expand Up @@ -34,6 +35,11 @@ internal void InitializeDatabase()
SaveChanges();
}

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.ConfigureWarnings(w => w.Ignore(CosmosEventId.SyncNotSupported));
}

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<CosmosEntityMovie>(builder =>
Expand Down
Loading