diff --git a/src/EFCore.Analyzers/EFCore.Analyzers.csproj b/src/EFCore.Analyzers/EFCore.Analyzers.csproj index beacecfce80..42b52137491 100644 --- a/src/EFCore.Analyzers/EFCore.Analyzers.csproj +++ b/src/EFCore.Analyzers/EFCore.Analyzers.csproj @@ -60,4 +60,8 @@ + + + + diff --git a/src/EFCore.Cosmos/EFCore.Cosmos.csproj b/src/EFCore.Cosmos/EFCore.Cosmos.csproj index 4b064e25562..fb6adb1ed17 100644 --- a/src/EFCore.Cosmos/EFCore.Cosmos.csproj +++ b/src/EFCore.Cosmos/EFCore.Cosmos.csproj @@ -43,7 +43,7 @@ - + diff --git a/src/EFCore.InMemory/EFCore.InMemory.csproj b/src/EFCore.InMemory/EFCore.InMemory.csproj index 9da79937fa6..bf88275bc8f 100644 --- a/src/EFCore.InMemory/EFCore.InMemory.csproj +++ b/src/EFCore.InMemory/EFCore.InMemory.csproj @@ -40,7 +40,7 @@ - + diff --git a/src/EFCore.Proxies/EFCore.Proxies.csproj b/src/EFCore.Proxies/EFCore.Proxies.csproj index 212bda63217..f57885d5ab1 100644 --- a/src/EFCore.Proxies/EFCore.Proxies.csproj +++ b/src/EFCore.Proxies/EFCore.Proxies.csproj @@ -43,7 +43,7 @@ - + diff --git a/src/EFCore.Relational/EFCore.Relational.csproj b/src/EFCore.Relational/EFCore.Relational.csproj index bac04d23a8f..789777a92cb 100644 --- a/src/EFCore.Relational/EFCore.Relational.csproj +++ b/src/EFCore.Relational/EFCore.Relational.csproj @@ -45,7 +45,7 @@ - + diff --git a/src/EFCore/ChangeTracking/LocalView.cs b/src/EFCore/ChangeTracking/LocalView.cs index 67887ccd149..a84f3010442 100644 --- a/src/EFCore/ChangeTracking/LocalView.cs +++ b/src/EFCore/ChangeTracking/LocalView.cs @@ -54,7 +54,9 @@ public class LocalView<[DynamicallyAccessedMembers(IEntityType.DynamicallyAccess IListSource where TEntity : class { +#pragma warning disable EF1001 private ObservableBackedBindingList? _bindingList; +#pragma warning restore EF1001 private ObservableCollection? _observable; private readonly DbContext _context; private readonly IEntityType _entityType; @@ -472,10 +474,12 @@ private void OnCollectionChanged(NotifyCollectionChangedAction action, object it /// examples. /// /// The binding list. +#pragma warning disable EF1001 [RequiresUnreferencedCode( "BindingList raises ListChanged events with PropertyDescriptors. PropertyDescriptors require unreferenced code.")] public virtual BindingList ToBindingList() => _bindingList ??= new ObservableBackedBindingList(ToObservableCollection()); +#pragma warning restore EF1001 /// /// This method is called by data binding frameworks when attempting to data bind diff --git a/src/EFCore/EFCore.csproj b/src/EFCore/EFCore.csproj index f8ba3e739d9..57f5adea13e 100644 --- a/src/EFCore/EFCore.csproj +++ b/src/EFCore/EFCore.csproj @@ -52,7 +52,7 @@ Microsoft.EntityFrameworkCore.DbSet - + diff --git a/src/EFCore/Properties/TypeForwards.cs b/src/EFCore/Properties/TypeForwards.cs index cb6700c69f9..6908949ff3c 100644 --- a/src/EFCore/Properties/TypeForwards.cs +++ b/src/EFCore/Properties/TypeForwards.cs @@ -4,8 +4,10 @@ using System.Runtime.CompilerServices; using Microsoft.EntityFrameworkCore.ChangeTracking.Internal; +#pragma warning disable EF1001 [assembly: TypeForwardedTo(typeof(ObservableBackedBindingList<>))] [assembly: TypeForwardedTo(typeof(ObservableCollectionExtensions))] [assembly: TypeForwardedTo(typeof(ObservableCollectionListSource<>))] [assembly: TypeForwardedTo(typeof(SortableBindingList<>))] [assembly: TypeForwardedTo(typeof(DeleteBehavior))] +#pragma warning restore EF1001 diff --git a/src/EFCore.Analyzers/EFDiagnostics.cs b/src/Shared/EFDiagnostics.cs similarity index 96% rename from src/EFCore.Analyzers/EFDiagnostics.cs rename to src/Shared/EFDiagnostics.cs index c3021424089..42476e39280 100644 --- a/src/EFCore.Analyzers/EFDiagnostics.cs +++ b/src/Shared/EFDiagnostics.cs @@ -6,7 +6,7 @@ namespace Microsoft.EntityFrameworkCore; /// /// Contains the IDs of diagnostics emitted by EF Core analyzers, [Experimental] and other mechanisms. /// -public static class EFDiagnostics +internal static class EFDiagnostics { public const string InternalUsage = "EF1001"; public const string InterpolatedStringUsageInRawQueries = "EF1002"; diff --git a/test/EFCore.Analyzers.Tests/EFCore.Analyzers.Tests.csproj b/test/EFCore.Analyzers.Tests/EFCore.Analyzers.Tests.csproj index d6d3557f289..f8cf05cd9d9 100644 --- a/test/EFCore.Analyzers.Tests/EFCore.Analyzers.Tests.csproj +++ b/test/EFCore.Analyzers.Tests/EFCore.Analyzers.Tests.csproj @@ -48,4 +48,8 @@ + + + +