diff --git a/net/DevExtreme.AspNet.Data.Tests/ResponseModelTests.cs b/net/DevExtreme.AspNet.Data.Tests/ResponseModelTests.cs index 31bcff21..e44ef000 100644 --- a/net/DevExtreme.AspNet.Data.Tests/ResponseModelTests.cs +++ b/net/DevExtreme.AspNet.Data.Tests/ResponseModelTests.cs @@ -33,6 +33,7 @@ public void EmptyGroupSerialization() { #if NET4 [Fact] public void JavaScriptSerializer() { +#pragma warning disable DX0011 // this is assembly with tests, known serializer type var serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); var loadResultJson = serializer.Serialize(new LoadResult()); @@ -42,6 +43,7 @@ public void JavaScriptSerializer() { Assert.Contains("\"summary\":", loadResultJson); var groupJson = serializer.Serialize(new Group()); +#pragma warning restore DX0011 // this is assembly with tests, known serializer type Assert.Contains("\"key\":", groupJson); Assert.Contains("\"items\":", groupJson); Assert.Contains("\"count\":", groupJson); diff --git a/net/DevExtreme.AspNet.Data/Async/ReflectionAsyncAdapter.cs b/net/DevExtreme.AspNet.Data/Async/ReflectionAsyncAdapter.cs index f944801f..1d0876c7 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 // known assembly and types var extensionsType = Type.GetType("System.Data.Entity.QueryableExtensions, EntityFramework"); +#pragma warning restore DX0004 // known assembly and types 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 // known assembly and types var extensionsType = Type.GetType("Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions, Microsoft.EntityFrameworkCore"); +#pragma warning restore DX0004 // known assembly and types 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 // known assembly and types var extensionsType = Type.GetType("NHibernate.Linq.LinqExtensionMethods, NHibernate"); +#pragma warning restore DX0004 // known assembly and types 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 // known assembly and types var extensionsType = asm.GetType("DevExpress.Xpo.XPQueryExtensions"); +#pragma warning restore DX0004 // known assembly and types CountAsyncMethod = FindCountAsyncMethod(extensionsType); ToArrayAsyncMethod = FindToArrayAsyncMethod(extensionsType); } diff --git a/net/DevExtreme.AspNet.Data/QueryProviderInfo.cs b/net/DevExtreme.AspNet.Data/QueryProviderInfo.cs index 1aa740b0..27a8a7b1 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 // known assembly providerAssembly = Assembly.Load("Microsoft.EntityFrameworkCore"); +#pragma warning restore DX0010 // known assembly break; case "LinqKit.EntityFramework": IsEFClassic = true; +#pragma warning disable DX0010 // known assembly providerAssembly = Assembly.Load("EntityFramework"); +#pragma warning restore DX0010 // known assembly break; } } diff --git a/net/DevExtreme.AspNet.Data/Types/DynamicClassBridge.cs b/net/DevExtreme.AspNet.Data/Types/DynamicClassBridge.cs index 2be429dc..0baf44c6 100644 --- a/net/DevExtreme.AspNet.Data/Types/DynamicClassBridge.cs +++ b/net/DevExtreme.AspNet.Data/Types/DynamicClassBridge.cs @@ -16,10 +16,12 @@ static readonly MethodInfo static DynamicClassBridge() { try { +#pragma warning disable DX0010,DX0004 // known assembly and types var assembly = Assembly.Load("System.Linq.Dynamic.Core"); 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 DX0010,DX0004 // known assembly and types CREATE_TYPE_METHOD = FACTORY_TYPE.GetMethod("CreateType"); INDEXER_METHOD = CLASS_TYPE.GetMethod("get_Item"); } catch(FileNotFoundException x) {