Skip to content

Commit 42edc19

Browse files
authored
Merge pull request #4 from ig-robstoffers/patch-2
resolving schema types
2 parents b3d28bb + 7d3fad9 commit 42edc19

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

DataSource.DataProviders.SQLite/SQLiteDataProvider/SQLiteVirtualDataSourceDataProvider.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,23 @@ public int IndexOfKey(object[] key)
685685
{
686686
return -1;
687687
}
688+
689+
public DataSourceSchemaPropertyType ResolveSchemaPropertyType(string propertyPath)
690+
{
691+
var propertiesInPath = propertyPath.Split('.');
692+
if (propertiesInPath.Length == 1 && this.ActualSchema != null)
693+
{
694+
for (int i = 0; i < this.ActualSchema.PropertyNames.Length; i++)
695+
{
696+
if (this.ActualSchema.PropertyNames[i] == propertiesInPath[0])
697+
{
698+
return this.ActualSchema.PropertyTypes[i];
699+
}
700+
}
701+
}
702+
703+
return DataSourceSchemaPropertyType.ObjectValue;
704+
}
688705
}
689706

690707

ODataDataProvider/ODataVirtualDataSourceDataProvider.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,23 @@ public int IndexOfKey(object[] key)
620620
{
621621
return -1;
622622
}
623+
624+
public DataSourceSchemaPropertyType ResolveSchemaPropertyType(string propertyPath)
625+
{
626+
var propertiesInPath = propertyPath.Split('.');
627+
if (propertiesInPath.Length == 1 && this.ActualSchema != null)
628+
{
629+
for (int i = 0; i < this.ActualSchema.PropertyNames.Length; i++)
630+
{
631+
if (this.ActualSchema.PropertyNames[i] == propertiesInPath[0])
632+
{
633+
return this.ActualSchema.PropertyTypes[i];
634+
}
635+
}
636+
}
637+
638+
return DataSourceSchemaPropertyType.ObjectValue;
639+
}
623640
}
624641

625642

0 commit comments

Comments
 (0)