Skip to content

Commit

Permalink
applied the #110 fix to SQL data source & the 'get by keys' method no…
Browse files Browse the repository at this point in the history
…w return data in the DotNet and SQL data-sources
  • Loading branch information
Hendy committed Apr 20, 2017
1 parent bffe39e commit 24de556
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions source/nuPickers/Shared/DotNetDataSource/DotNetDataSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ public class DotNetDataSource : IDataSource

public IEnumerable<EditorDataItem> GetEditorDataItems(int currentId, int parentId, string typeahead)
{
return this.GetEditorDataItems(currentId == 0 ? parentId : currentId); // fix from PR #110
return this.GetEditorDataItems(currentId == 0 ? parentId : currentId, typeahead); // fix from PR #110
}

public IEnumerable<EditorDataItem> GetEditorDataItems(int currentId, int parentId, string[] keys)
{
return Enumerable.Empty<EditorDataItem>();
return this.GetEditorDataItems(currentId == 0 ? parentId : currentId).Where(x => keys.Contains(x.Key));
//TODO: update public IDotNetDataSource so keys can be passed though (so it can do a more efficient query)
}

[Obsolete("[v2.0.0]")]
Expand Down
4 changes: 2 additions & 2 deletions source/nuPickers/Shared/SqlDataSource/SqlDataSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public class SqlDataSource : IDataSource

public IEnumerable<EditorDataItem> GetEditorDataItems(int currentId, int parentId, string typeahead)
{
return this.GetEditorDataItems(currentId, typeahead);
return this.GetEditorDataItems(currentId == 0 ? parentId : currentId, typeahead);
}

public IEnumerable<EditorDataItem> GetEditorDataItems(int currentId, int parentId, string[] keys)
{
return Enumerable.Empty<EditorDataItem>();
return this.GetEditorDataItems(currentId == 0 ? parentId : currentId).Where(x => keys.Contains(x.Key));
}

[Obsolete("[v2.0.0]")]
Expand Down

0 comments on commit 24de556

Please sign in to comment.