CommonExtensions

Provides commonly used extensions.

Namespace:
Inetdev.Data
Type:
Class
Public:
Yes
Protected:
No
Sealed:
Yes
Abstract:
Yes
Inherits from:
System.Object

Methods

FormatForLogging

Formats the command to by written.

Signature:
public String FormatForLogging(command)
Returns

A textual representation of a command.

Parameters
Name Type Summary
command IDbCommand Command to be written.

GetAutomaticDataProperty

Gets the first IDataProperty within the collection that matches the automaticType property. If no property matches the automatic type or automaticType is Nonenull is returned.

Signature:
public IDataProperty GetAutomaticDataProperty(properties, automaticType)
Returns

An IDataProperty of null if none matches.

Parameters
Name Type Summary
properties ICollection<IDataProperty> A collection of properties.
automaticType AutomaticType Automatic type to find.
Exceptions
Type Summary
ArgumentNullException Thrown when properties is null.

GetAutomaticField

Gets the first Field within the collection that matches the automaticType property. If no fields matches the automatic type or automaticType is Nonenull is returned.

Signature:
public Field GetAutomaticField(fields, automaticType)
Returns

A Field of null if none matches.

Parameters
Name Type Summary
fields ICollection<Field> A collection of fields.
automaticType AutomaticType Automatic type to find.
Exceptions
Type Summary
ArgumentNullException Thrown when fields is null.

GetField

Gets the first Field within the collection that matches the name. If no fields matches the specified namenull is returned.

Signature:
public Field GetField(fields, name)
Returns

A Field of null if none matches.

Parameters
Name Type Summary
fields ICollection<Field> A collection of fields.
name String Name of the field to match (case sensitive).
Exceptions
Type Summary
ArgumentNullException Thrown when fields is null.

GetPartitionKeyPropertyName

Gets the name of the partition key data property or null if model does not has a partition key property.

Signature:
public String GetPartitionKeyPropertyName(model)
Returns

The name of the partition key property or null.

Parameters
Name Type Summary
model IDataModel An IDataModel.
Exceptions
Type Summary
ArgumentNullException Thrown when model is null.

HasPrimaryKeys

Finds if the fields collection has primary key fields.

Signature:
public Boolean HasPrimaryKeys(fields)
Returns

true if the collection has primary key fields.

Parameters
Name Type Summary
fields ICollection<Field> A collection of fields.
Exceptions
Type Summary
ArgumentNullException Thrown when fields is null.

IsDataProperty

Checks whether the property is an IDataProperty.

Signature:
public Boolean IsDataProperty(property)
Returns

true if property is an IDataProperty, otherwise false.

Parameters
Name Type Summary
property PropertyInfo A PropertyInfo for the property to check.
Exceptions
Type Summary
ArgumentNullException Thrown when property is null.