Skip to content

Commit cfed935

Browse files
Update to fix issue #91
1 parent d332c79 commit cfed935

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

libraries/MTConnect.NET-Common/Devices/Component.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ public IDataItem GetDataItemByType(string type, SearchType searchType = SearchTy
796796

797797
if (!dataItems.IsNullOrEmpty())
798798
{
799-
return dataItems.FirstOrDefault(o => o.Type == type);
799+
return dataItems.FirstOrDefault(o => o.Type == type.ToUnderscoreUpper());
800800
}
801801
}
802802

@@ -819,7 +819,7 @@ public IDataItem GetDataItemByType(string type, string subType, SearchType searc
819819

820820
if (!dataItems.IsNullOrEmpty())
821821
{
822-
return dataItems.FirstOrDefault(o => o.Type == type && o.SubType == subType);
822+
return dataItems.FirstOrDefault(o => o.Type == type.ToUnderscoreUpper() && o.SubType == subType.ToUnderscoreUpper());
823823
}
824824
}
825825

@@ -860,7 +860,7 @@ public IEnumerable<IDataItem> GetDataItemsByType(string type, SearchType searchT
860860

861861
if (!dataItems.IsNullOrEmpty())
862862
{
863-
return dataItems.Where(o => o.Type == type);
863+
return dataItems.Where(o => o.Type == type.ToUnderscoreUpper());
864864
}
865865
}
866866

@@ -883,7 +883,7 @@ public IEnumerable<IDataItem> GetDataItemsByType(string type, string subType, Se
883883

884884
if (!dataItems.IsNullOrEmpty())
885885
{
886-
return dataItems.Where(o => o.Type == type && o.SubType == subType);
886+
return dataItems.Where(o => o.Type == type.ToUnderscoreUpper() && o.SubType == subType.ToUnderscoreUpper());
887887
}
888888
}
889889

libraries/MTConnect.NET-Common/Devices/Device.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ public IDataItem GetDataItemByType(string type, SearchType searchType = SearchTy
765765

766766
if (!dataItems.IsNullOrEmpty())
767767
{
768-
return dataItems.FirstOrDefault(o => o.Type == type);
768+
return dataItems.FirstOrDefault(o => o.Type == type.ToUnderscoreUpper());
769769
}
770770
}
771771

@@ -788,7 +788,7 @@ public IDataItem GetDataItemByType(string type, string subType, SearchType searc
788788

789789
if (!dataItems.IsNullOrEmpty())
790790
{
791-
return dataItems.FirstOrDefault(o => o.Type == type && o.SubType == subType);
791+
return dataItems.FirstOrDefault(o => o.Type == type.ToUnderscoreUpper() && o.SubType == subType.ToUnderscoreUpper());
792792
}
793793
}
794794

@@ -852,7 +852,7 @@ public IEnumerable<IDataItem> GetDataItemsByType(string type, string subType, Se
852852

853853
if (!dataItems.IsNullOrEmpty())
854854
{
855-
return dataItems.Where(o => o.Type == type && o.SubType == subType);
855+
return dataItems.Where(o => o.Type == type.ToUnderscoreUpper() && o.SubType == subType.ToUnderscoreUpper());
856856
}
857857
}
858858

0 commit comments

Comments
 (0)