/// <summary> /// Loads one row cast per Query(T) or null /// </summary> public static TRow LoadRow <TRow>(this ICRUDOperations operations, Query <TRow> query) where TRow : Row { if (operations == null || query == null) { throw new NFXException(StringConsts.ARGUMENT_ERROR + "LoadRow(ICRUDOperations==null | query==null)"); } return(operations.LoadOneRow(query) as TRow); }
/// <summary> /// Loads rowset with rows cast per Query(T) or empty enum /// </summary> public static IEnumerable <TRow> LoadEnumerable <TRow>(this ICRUDOperations operations, Query <TRow> query) where TRow : Row { if (operations == null || query == null) { throw new NFXException(StringConsts.ARGUMENT_ERROR + "LoadEnumerable(ICRUDOperations==null | query==null)"); } return(operations.LoadOneRowset(query).AsEnumerableOf <TRow>()); }
/// <summary> /// Loads one document cast per Query(T) or null /// </summary> public static TDoc LoadDoc <TDoc>(this ICRUDOperations operations, Query <TDoc> query) where TDoc : Doc { if (operations == null || query == null) { throw new AzosException(StringConsts.ARGUMENT_ERROR + "LoadDoc(ICRUDOperations==null | query==null)"); } return(operations.LoadOneDoc(query) as TDoc); }
/// <summary> /// Async version - loads rowset with rows cast per Query(T) or empty enum /// </summary> public static Task <IEnumerable <TRow> > LoadEnumerableAsync <TRow>(this ICRUDOperations operations, Query <TRow> query) where TRow : Row { if (operations == null || query == null) { throw new NFXException(StringConsts.ARGUMENT_ERROR + "LoadEnumerableAsync(ICRUDOperations==null | query==null)"); } return(operations.LoadOneRowsetAsync(query) .ContinueWith <IEnumerable <TRow> >((antecedent) => antecedent.Result.AsEnumerableOf <TRow>())); }
/// <summary> /// Async version - loads one doc cast per Query(T) or null /// </summary> public static Task <TDoc> LoadDocAsync <TDoc>(this ICRUDOperations operations, Query <TDoc> query) where TDoc : Doc { if (operations == null || query == null) { throw new AzosException(StringConsts.ARGUMENT_ERROR + "LoadDocAsync(ICRUDOperations==null | query==null)"); } return(operations.LoadOneDocAsync(query) .ContinueWith <TDoc>((antecedent) => antecedent.Result as TDoc)); }
/// <summary> /// Async version - loads docset with rows cast per Query(T) or empty enum /// </summary> public static async Task <IEnumerable <TDoc> > LoadEnumerableAsync <TDoc>(this ICRUDOperations operations, Query <TDoc> query) where TDoc : Doc { if (operations == null || query == null) { throw new AzosException(StringConsts.ARGUMENT_ERROR + "LoadEnumerableAsync(ICRUDOperations==null | query==null)"); } var got = await operations.LoadOneRowsetAsync(query).ConfigureAwait(false); return(got.AsEnumerableOf <TDoc>()); }
/// <summary> /// Async version - loads one doc cast per Query(T) or null /// </summary> public static async Task <TDoc> LoadDocAsync <TDoc>(this ICRUDOperations operations, Query <TDoc> query) where TDoc : Doc { if (operations == null || query == null) { throw new AzosException(StringConsts.ARGUMENT_ERROR + "LoadDocAsync(ICRUDOperations==null | query==null)"); } var got = await operations.LoadOneDocAsync(query).ConfigureAwait(false); return(got as TDoc); }
public SymbolManager(Data.Context db, Config cfg) : base(db) { MaxResults = cfg.MaxSymsPerPage; LangManager = new LangManager(db); TypeManager = new TypeManager(db); }