|
|
|
|
@ -101,8 +101,9 @@ namespace GBase |
|
|
|
|
if (Tables.OfType<IGBaseTable<T>>().Any()) |
|
|
|
|
return Tables.OfType<IGBaseTable<T>>().First(); |
|
|
|
|
|
|
|
|
|
//TODO: This probably doesn't work, because even though t.Type : T, IGBaseTable<t.Type> !: IGBaseTable<T> |
|
|
|
|
return (IGBaseTable<T>) Tables.FirstOrDefault(t => typeof(T).IsAssignableFrom(t.Type)); //TestMe |
|
|
|
|
throw new MissingTableException<T>(); |
|
|
|
|
// //TODO: This probably doesn't work, because even though t.Type : T, IGBaseTable<t.Type> !: IGBaseTable<T> |
|
|
|
|
// return (IGBaseTable<T>) Convert.ChangeType(Tables.FirstOrDefault(t => typeof(T).IsAssignableFrom(t.Type)), typeof(IGBaseTable<T>)); //TestMe |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
@ -149,7 +150,7 @@ namespace GBase |
|
|
|
|
{ |
|
|
|
|
IGBaseTable<T> table = GetTable<T>(); |
|
|
|
|
if (table == null) |
|
|
|
|
throw new Exception(); //TODO: Create exception |
|
|
|
|
throw new MissingTableException<T>(); |
|
|
|
|
|
|
|
|
|
return await table.GetValues<TProperty>(entry, propertyName, cancellationToken); |
|
|
|
|
} |
|
|
|
|
|