forked from ThatRendle/Simple.Data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIAdapterWithRelation.cs
More file actions
30 lines (28 loc) · 1.27 KB
/
IAdapterWithRelation.cs
File metadata and controls
30 lines (28 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Simple.Data
{
public interface IAdapterWithRelation
{
/// <summary>
/// Determines whether a relation is valid.
/// </summary>
/// <param name="tableName">Name of the known table.</param>
/// <param name="relatedTableName">Name of the table to test.</param>
/// <returns>
/// <c>true</c> if there is a valid relation; otherwise, <c>false</c>.
/// </returns>
bool IsValidRelation(string tableName, string relatedTableName);
/// <summary>
/// Finds data from a "table" related to the specified "table".
/// </summary>
/// <param name="tableName">Name of the table.</param>
/// <param name="row"></param>
/// <param name="relatedTableName"></param>
/// <returns>The list of records matching the criteria. If no records are found, return an empty list.</returns>
/// <remarks>When implementing the <see cref="Adapter"/> interface, if relationships are not possible, throw a <see cref="NotSupportedException"/>.</remarks>
object FindRelated(string tableName, IDictionary<string, object> row, string relatedTableName);
}
}