Class DataUtils
Provides various extension methods for construction of FieldFilterFunc and casting rowsets
Inheritance
System.Object
DataUtils
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Azos
Assembly: Azos.dll
Syntax
public static class DataUtils
Methods
AllButTheseFields(IEnumerable<String>, Boolean)
Converts field names separated by ',' or ';' into a FieldFilterFunction
Declaration
public static FieldFilterFunc AllButTheseFields(this IEnumerable<string> fields, bool caseSensitive = false)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.String> |
fields |
|
System.Boolean |
caseSensitive |
|
Returns
AllButTheseFields(String, Boolean)
Converts field names separated by ',' or ';' into a FieldFilterFunction
Declaration
public static FieldFilterFunc AllButTheseFields(this string fields, bool caseSensitive = false)
Parameters
Type |
Name |
Description |
System.String |
fields |
|
System.Boolean |
caseSensitive |
|
Returns
AsEnumerableOf<TDoc>(IEnumerable<Doc>)
Casts enumerable of rows (such as rowset) to the specified row type, returning empty enumerable if the source is null
Declaration
public static IEnumerable<TDoc> AsEnumerableOf<TDoc>(this IEnumerable<Doc> source)
where TDoc : Doc
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<Doc> |
source |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TDoc> |
|
Type Parameters
Clone<TDoc>(TDoc, String, Boolean, Boolean, Func<String, Schema.FieldDef, Boolean>, Func<String, String, Boolean>)
If source is not null, creates a shallow clone using 'source.CopyFields(copy)'
Declaration
public static TDoc Clone<TDoc>(this TDoc source, string targetName = null, bool includeAmorphousData = true, bool invokeAmorphousAfterLoad = true, Func<string, Schema.FieldDef, bool> fieldFilter = null, Func<string, string, bool> amorphousFieldFilter = null)
where TDoc : Doc
Parameters
Type |
Name |
Description |
TDoc |
source |
|
System.String |
targetName |
|
System.Boolean |
includeAmorphousData |
|
System.Boolean |
invokeAmorphousAfterLoad |
|
System.Func<System.String, Schema.FieldDef, System.Boolean> |
fieldFilter |
|
System.Func<System.String, System.String, System.Boolean> |
amorphousFieldFilter |
|
Returns
Type Parameters
LoadDoc<TDoc>(ICRUDOperations, Query<TDoc>)
Loads one document cast per Query(T) or null
Declaration
public static TDoc LoadDoc<TDoc>(this ICRUDOperations operations, Query<TDoc> query)
where TDoc : Doc
Parameters
Returns
Type Parameters
LoadDocAsync<TDoc>(ICRUDOperations, Query<TDoc>)
Async version - loads one doc cast per Query(T) or null
Declaration
public static Task<TDoc> LoadDocAsync<TDoc>(this ICRUDOperations operations, Query<TDoc> query)
where TDoc : Doc
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<TDoc> |
|
Type Parameters
LoadEnumerable<TDoc>(ICRUDOperations, Query<TDoc>)
Loads docset with docs cast per Query(T) or empty enum
Declaration
public static IEnumerable<TDoc> LoadEnumerable<TDoc>(this ICRUDOperations operations, Query<TDoc> query)
where TDoc : Doc
Parameters
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TDoc> |
|
Type Parameters
LoadEnumerableAsync<TDoc>(ICRUDOperations, Query<TDoc>)
Async version - loads docset with rows cast per Query(T) or empty enum
Declaration
public static Task<IEnumerable<TDoc>> LoadEnumerableAsync<TDoc>(this ICRUDOperations operations, Query<TDoc> query)
where TDoc : Doc
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<TDoc>> |
|
Type Parameters
OnlyTheseFields(IEnumerable<String>, Boolean)
Converts field names separated by ',' or ';' into a FieldFilterFunction
Declaration
public static FieldFilterFunc OnlyTheseFields(this IEnumerable<string> fields, bool caseSensitive = false)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.String> |
fields |
|
System.Boolean |
caseSensitive |
|
Returns
OnlyTheseFields(String, Boolean)
Converts field names separated by ',' or ';' into a FieldFilterFunction
Declaration
public static FieldFilterFunc OnlyTheseFields(this string fields, bool caseSensitive = false)
Parameters
Type |
Name |
Description |
System.String |
fields |
|
System.Boolean |
caseSensitive |
|
Returns
Validate(Doc, IApplication, String)
Perform app context injection and calls Validate() on a data Doc
Declaration
public static Exception Validate(this Doc doc, IApplication app, string targetName = null)
Parameters
Returns
Type |
Description |
System.Exception |
|