Class CogniteResult<TError>
Represents the result of one or more pushes to CDF. Contains a list of errors, one for each failed push, and potentially pre-push santiation.
Inherited Members
Namespace: Cognite.Extensions
Assembly: Cognite.Extensions.dll
Syntax
public class CogniteResult<TError>
Type Parameters
Name | Description |
---|---|
TError |
Constructors
| Edit this page View SourceCogniteResult(IEnumerable<CogniteError<TError>>?)
Constructor
Declaration
public CogniteResult(IEnumerable<CogniteError<TError>>? errors)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<CogniteError<TError>> | errors | Initial list of errors |
Properties
| Edit this page View SourceAllSkipped
All items that were skipped in this result, accross all errors.
Declaration
public IEnumerable<TError> AllSkipped { get; }
Property Value
Type | Description |
---|---|
IEnumerable<TError> |
Errors
Errors that have occured in this series of requests
Declaration
public IEnumerable<CogniteError<TError>>? Errors { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<CogniteError<TError>> |
IsAllGood
True if nothing went wrong
Declaration
public bool IsAllGood { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceErrorsBySkipped()
Return a grouping of skipped error objects with a list of the errors that caused them to be skipped. Useful for reporting a list of individual errors per passed resource.
Declaration
public IEnumerable<(TError Skipped, IEnumerable<CogniteError<TError>> Errors)> ErrorsBySkipped()
Returns
Type | Description |
---|---|
IEnumerable<(TError Skipped, IEnumerable<CogniteError<TError>> Errors)> | Errors grouped by skipped objects |
Merge(CogniteResult<TError>?)
Return a new CogniteResult that contains errors from both
Declaration
public CogniteResult<TError> Merge(CogniteResult<TError>? other)
Parameters
Type | Name | Description |
---|---|---|
CogniteResult<TError> | other | CogniteResult to merge with |
Returns
Type | Description |
---|---|
CogniteResult<TError> | A new result containing the CogniteErrors from both results |
Merge(params CogniteResult<TError>[]?)
Return a new CogniteResult that contains errors from all results
given as parameter
Declaration
public static CogniteResult<TError> Merge(params CogniteResult<TError>[]? results)
Parameters
Type | Name | Description |
---|---|---|
CogniteResult<TError>[] | results | List of CogniteResult to merge with |
Returns
Type | Description |
---|---|
CogniteResult<TError> | A new result containing the CogniteErrors from all results given as parameter |
MergeErrors()
Combine all non-fatal errors with the same resource and type
Declaration
public void MergeErrors()
Replace<TRep>(Func<TError, TRep>)
Replace errors in this cognite result using replace
.
Used when the return type of a method is different from type of internal method
(like upsert).
Declaration
public CogniteResult<TRep> Replace<TRep>(Func<TError, TRep> replace)
Parameters
Type | Name | Description |
---|---|---|
Func<TError, TRep> | replace | Method to replace error type |
Returns
Type | Description |
---|---|
CogniteResult<TRep> | Result with all errors replaced |
Type Parameters
Name | Description |
---|---|
TRep | New error type |
Throw()
Throw exception if there are any errors at all.
Declaration
public void Throw()
ThrowOnFatal()
Throw exception if there are any fatal errors
Declaration
public void ThrowOnFatal()