Skip to content

Commit

Permalink
Mitigate diagnostics (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpreyskurantov authored Jul 5, 2024
1 parent 17125a2 commit bacf9cf
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
3 changes: 2 additions & 1 deletion net/DevExtreme.AspNet.Data.Tests.NH/RemoteGroupingStress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
3 changes: 2 additions & 1 deletion net/DevExtreme.AspNet.Data.Tests.Xpo/RemoteGroupingStress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion net/DevExtreme.AspNet.Data.Tests/ResponseModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions net/DevExtreme.AspNet.Data/Async/ReflectionAsyncAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down
4 changes: 4 additions & 0 deletions net/DevExtreme.AspNet.Data/QueryProviderInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
4 changes: 4 additions & 0 deletions net/DevExtreme.AspNet.Data/Types/DynamicClassBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit bacf9cf

Please sign in to comment.