From 21fdd156db41feb948917fc7b8bbba4a7072423b Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Tue, 2 Jul 2024 23:00:18 +0300 Subject: [PATCH 1/2] #pragma warning disable xUnit1004 --- net/DevExtreme.AspNet.Data.Tests.NH/RemoteGroupingStress.cs | 3 ++- net/DevExtreme.AspNet.Data.Tests.Xpo/RemoteGroupingStress.cs | 3 ++- net/DevExtreme.AspNet.Data.Tests/ResponseModelTests.cs | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/net/DevExtreme.AspNet.Data.Tests.NH/RemoteGroupingStress.cs b/net/DevExtreme.AspNet.Data.Tests.NH/RemoteGroupingStress.cs index 6f0dc7aa..089ed37f 100644 --- a/net/DevExtreme.AspNet.Data.Tests.NH/RemoteGroupingStress.cs +++ b/net/DevExtreme.AspNet.Data.Tests.NH/RemoteGroupingStress.cs @@ -30,8 +30,9 @@ public DataItemMap() { //Map(i => i.DateO); //used by all fixtures, requires nh feature support (see skip) } } - +#pragma warning disable xUnit1004 [Fact(Skip = "Skip until https://github.com/nhibernate/nhibernate-core/issues/2912 is implemented?")] +#pragma warning restore xUnit1004 public async Task Scenario() { await SessionFactoryHelper.ExecAsync(session => { session.Save(new DataItem()); diff --git a/net/DevExtreme.AspNet.Data.Tests.Xpo/RemoteGroupingStress.cs b/net/DevExtreme.AspNet.Data.Tests.Xpo/RemoteGroupingStress.cs index e5473f63..f072a33f 100644 --- a/net/DevExtreme.AspNet.Data.Tests.Xpo/RemoteGroupingStress.cs +++ b/net/DevExtreme.AspNet.Data.Tests.Xpo/RemoteGroupingStress.cs @@ -55,8 +55,9 @@ public DateOnly DateO { } //#endif } - +#pragma warning disable xUnit1004 [Fact(Skip = "Skip until proper DevExpress.Xpo dll / nupkg with Date Time Only support?")] +#pragma warning restore xUnit1004 public async Task Scenario() { await UnitOfWorkHelper.ExecAsync(uow => { new DataItem(uow); diff --git a/net/DevExtreme.AspNet.Data.Tests/ResponseModelTests.cs b/net/DevExtreme.AspNet.Data.Tests/ResponseModelTests.cs index aaf26dca..f74293c7 100644 --- a/net/DevExtreme.AspNet.Data.Tests/ResponseModelTests.cs +++ b/net/DevExtreme.AspNet.Data.Tests/ResponseModelTests.cs @@ -6,8 +6,9 @@ namespace DevExtreme.AspNet.Data.Tests { public class ResponseModelTests { - +#pragma warning disable xUnit1004 [Fact(Skip = "Skip until consolidation or target bump to net7 and ShouldSerialize")] +#pragma warning restore xUnit1004 public void EmptyLoadResultSerialization() { //https://github.com/dotnet/runtime/issues/41630 //https://github.com/dotnet/runtime/issues/36236 From f9a9c8fec59a3611c524223887b6bf408a6ef910 Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Tue, 2 Jul 2024 23:32:22 +0300 Subject: [PATCH 2/2] #pragma warning disable DX0004, DX0010 --- .../Async/ReflectionAsyncAdapter.cs | 8 ++++++++ net/DevExtreme.AspNet.Data/QueryProviderInfo.cs | 4 ++++ net/DevExtreme.AspNet.Data/Types/DynamicClassBridge.cs | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/net/DevExtreme.AspNet.Data/Async/ReflectionAsyncAdapter.cs b/net/DevExtreme.AspNet.Data/Async/ReflectionAsyncAdapter.cs index f944801f..e97c6047 100644 --- a/net/DevExtreme.AspNet.Data/Async/ReflectionAsyncAdapter.cs +++ b/net/DevExtreme.AspNet.Data/Async/ReflectionAsyncAdapter.cs @@ -64,7 +64,9 @@ static class EF6Methods { public static readonly MethodInfo CountAsyncMethod; public static readonly MethodInfo ToListAsyncMethod; static EF6Methods() { +#pragma warning disable DX0004 var extensionsType = Type.GetType("System.Data.Entity.QueryableExtensions, EntityFramework"); +#pragma warning restore DX0004 CountAsyncMethod = FindCountAsyncMethod(extensionsType); ToListAsyncMethod = FindToListAsyncMethod(extensionsType); } @@ -74,7 +76,9 @@ static class EFCoreMethods { public static readonly MethodInfo CountAsyncMethod; public static readonly MethodInfo ToListAsyncMethod; static EFCoreMethods() { +#pragma warning disable DX0004 var extensionsType = Type.GetType("Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions, Microsoft.EntityFrameworkCore"); +#pragma warning restore DX0004 CountAsyncMethod = FindCountAsyncMethod(extensionsType); ToListAsyncMethod = FindToListAsyncMethod(extensionsType); } @@ -84,7 +88,9 @@ static class NHMethods { public static readonly MethodInfo CountAsyncMethod; public static readonly MethodInfo ToListAsyncMethod; static NHMethods() { +#pragma warning disable DX0004 var extensionsType = Type.GetType("NHibernate.Linq.LinqExtensionMethods, NHibernate"); +#pragma warning restore DX0004 CountAsyncMethod = FindCountAsyncMethod(extensionsType); ToListAsyncMethod = FindToListAsyncMethod(extensionsType); } @@ -95,7 +101,9 @@ static class XpoMethods { public static readonly MethodInfo ToArrayAsyncMethod; static XpoMethods() { var asm = Array.Find(AppDomain.CurrentDomain.GetAssemblies(), a => a.FullName.StartsWith("DevExpress.Xpo.v")); +#pragma warning disable DX0004 var extensionsType = asm.GetType("DevExpress.Xpo.XPQueryExtensions"); +#pragma warning restore DX0004 CountAsyncMethod = FindCountAsyncMethod(extensionsType); ToArrayAsyncMethod = FindToArrayAsyncMethod(extensionsType); } diff --git a/net/DevExtreme.AspNet.Data/QueryProviderInfo.cs b/net/DevExtreme.AspNet.Data/QueryProviderInfo.cs index 1aa740b0..5192b614 100644 --- a/net/DevExtreme.AspNet.Data/QueryProviderInfo.cs +++ b/net/DevExtreme.AspNet.Data/QueryProviderInfo.cs @@ -38,12 +38,16 @@ public QueryProviderInfo(IQueryProvider provider) { switch(providerAssembly.GetName().Name) { case "LinqKit.Microsoft.EntityFrameworkCore": IsEFCore = true; +#pragma warning disable DX0010 providerAssembly = Assembly.Load("Microsoft.EntityFrameworkCore"); +#pragma warning restore DX0010 break; case "LinqKit.EntityFramework": IsEFClassic = true; +#pragma warning disable DX0010 providerAssembly = Assembly.Load("EntityFramework"); +#pragma warning restore DX0010 break; } } diff --git a/net/DevExtreme.AspNet.Data/Types/DynamicClassBridge.cs b/net/DevExtreme.AspNet.Data/Types/DynamicClassBridge.cs index 2be429dc..fd17d69b 100644 --- a/net/DevExtreme.AspNet.Data/Types/DynamicClassBridge.cs +++ b/net/DevExtreme.AspNet.Data/Types/DynamicClassBridge.cs @@ -16,10 +16,14 @@ static readonly MethodInfo static DynamicClassBridge() { try { +#pragma warning disable DX0010 var assembly = Assembly.Load("System.Linq.Dynamic.Core"); +#pragma warning restore DX0010 +#pragma warning disable DX0004 FACTORY_TYPE = assembly.GetType("System.Linq.Dynamic.Core.DynamicClassFactory"); CLASS_TYPE = assembly.GetType("System.Linq.Dynamic.Core.DynamicClass"); PROP_TYPE = assembly.GetType("System.Linq.Dynamic.Core.DynamicProperty"); +#pragma warning restore DX0004 CREATE_TYPE_METHOD = FACTORY_TYPE.GetMethod("CreateType"); INDEXER_METHOD = CLASS_TYPE.GetMethod("get_Item"); } catch(FileNotFoundException x) {