Show / Hide Table of Contents

Class ValidationContext

Context for a server method which is used on before add or update of an item.

Inheritance
System.Object
ValidationContext
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: Innovator.Server
Assembly: Innovator.Client.dll
Syntax
public class ValidationContext : IValidationContext, IContext

Constructors

| Improve this Doc View Source

ValidationContext(IServerConnection, IItem)

Initializes a new instance of the ValidationContext class.

Declaration
public ValidationContext(IServerConnection conn, IItem changes)
Parameters
Type Name Description
IServerConnection conn

The connection.

IItem changes

The changes.

Properties

| Improve this Doc View Source

Conn

Connection to the database

Declaration
public IServerConnection Conn { get; }
Property Value
Type Description
IServerConnection
Implements
IContext.Conn
| Improve this Doc View Source

ErrorBuilder

Error builder which captures any errors which are encountered

Declaration
public IErrorBuilder ErrorBuilder { get; }
Property Value
Type Description
IErrorBuilder
Implements
IValidationContext.ErrorBuilder
| Improve this Doc View Source

Exception

Get the exception object created for any errors that have happened so far.

Declaration
public Exception Exception { get; }
Property Value
Type Description
System.Exception
Implements
IValidationContext.Exception
| Improve this Doc View Source

Existing

Get the existing item in the database

Declaration
public IReadOnlyItem Existing { get; }
Property Value
Type Description
IReadOnlyItem
Implements
IValidationContext.Existing
| Improve this Doc View Source

IsNew

Indicates if the argument is new (not in the database)

Declaration
public bool IsNew { get; }
Property Value
Type Description
System.Boolean
Implements
IValidationContext.IsNew
| Improve this Doc View Source

Item

The changes given to the database. This object should be modified to make any additional changes

Declaration
public IItem Item { get; }
Property Value
Type Description
IItem
Implements
IValidationContext.Item
| Improve this Doc View Source

Merged

Gets an item which represents the new item after the changes are applied

Declaration
public IReadOnlyItem Merged { get; }
Property Value
Type Description
IReadOnlyItem
Implements
IValidationContext.Merged
| Improve this Doc View Source

QueryDefaults

Method for modifying the query to get existing items

Declaration
public Action<IItem> QueryDefaults { get; set; }
Property Value
Type Description
System.Action<IItem>
Implements
IValidationContext.QueryDefaults

Methods

| Improve this Doc View Source

IsBeingSetNull(String)

Indicates if a property is being set null. Note that this does not detect if the property already is null.

Declaration
public bool IsBeingSetNull(string name)
Parameters
Type Name Description
System.String name

The name of the property to check

Returns
Type Description
System.Boolean

true if a non-null property is being set null with this query, false otherwise

Implements
IValidationContext.IsBeingSetNull(String)
| Improve this Doc View Source

IsChanging(String[])

Indicates if one or more properties in the list are changing

Declaration
public bool IsChanging(params string[] names)
Parameters
Type Name Description
System.String[] names

Property name(s)

Returns
Type Description
System.Boolean

true if at least one of the properties is being changed with this query, false otherwise

Implements
IValidationContext.IsChanging(String[])
| Improve this Doc View Source

NewOrExisting(String)

Gets a property from the Item item (if it exists). Otherwise, the property from Existing is returned

Declaration
public IReadOnlyProperty NewOrExisting(string name)
Parameters
Type Name Description
System.String name

Name of the property to retrieve

Returns
Type Description
IReadOnlyProperty

The IReadOnlyProperty from the incoming query (if defined). Otherwise, the IReadOnlyProperty from the database data

Implements
IValidationContext.NewOrExisting(String)
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX