Show / Hide Table of Contents

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.

Inheritance
object
CogniteResult<TError>
CogniteResult<TResult, TError>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Cognite.Extensions
Assembly: Cognite.Extensions.dll
Syntax
public class CogniteResult<TError>
Type Parameters
Name Description
TError

Constructors

| Edit this page View Source

CogniteResult(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 Source

AllSkipped

All items that were skipped in this result, accross all errors.

Declaration
public IEnumerable<TError> AllSkipped { get; }
Property Value
Type Description
IEnumerable<TError>
| Edit this page View Source

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>>
| Edit this page View Source

IsAllGood

True if nothing went wrong

Declaration
public bool IsAllGood { get; }
Property Value
Type Description
bool

Methods

| Edit this page View Source

ErrorsBySkipped()

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

| Edit this page View Source

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

| Edit this page View Source

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

| Edit this page View Source

MergeErrors()

Combine all non-fatal errors with the same resource and type

Declaration
public void MergeErrors()
| Edit this page View Source

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

| Edit this page View Source

Throw()

Throw exception if there are any errors at all.

Declaration
public void Throw()
| Edit this page View Source

ThrowOnFatal()

Throw exception if there are any fatal errors

Declaration
public void ThrowOnFatal()

Extension Methods

DataModelUtils.GetOrCreateResourcesAsync<T, T2>(T2, IEnumerable<InstanceIdentifier>, Func<IEnumerable<InstanceIdentifier>, IEnumerable<SourcedNodeWrite<T>>>, Func<IEnumerable<SourcedNodeWrite<T>>, SanitationMode, (IEnumerable<SourcedNodeWrite<T>>, IEnumerable<CogniteError<SourcedNodeWrite<T>>>)>, int, int, RetryMode, SanitationMode, CancellationToken)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX