Skip to content

Commit 5f43154

Browse files
Update DynamicClassBridge.cs
1 parent e396a9d commit 5f43154

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/DevExtreme.AspNet.Data/Types/DynamicClassBridge.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ static DynamicClassBridge() {
2323
PROP_TYPE = assembly.GetType("System.Linq.Dynamic.Core.DynamicProperty");
2424
#pragma warning restore DX0010,DX0004 // known assembly and types
2525
CREATE_TYPE_METHOD = FACTORY_TYPE.GetMethod("CreateType");
26-
INDEXER_METHOD = CLASS_TYPE.GetMethod("get_Item");
26+
27+
var indexerNameField = CLASS_TYPE.GetField("IndexerName", BindingFlags.NonPublic | BindingFlags.Static);
28+
var indexerName = indexerNameField?.GetValue(null) as string ?? "Item";
29+
INDEXER_METHOD = CLASS_TYPE.GetMethod("get_" + indexerName);
2730
} catch(FileNotFoundException x) {
2831
throw new Exception("Please install 'System.Linq.Dynamic.Core' package", x);
2932
}

0 commit comments

Comments
 (0)