Table of Contents

Interface IOrpheusModelHelper

Namespace
OrpheusInterfaces.Core
Assembly
OrpheusInterfaces.dll

Orpheus model helper

public interface IOrpheusModelHelper

Properties

CustomFieldNameProperties

Dictionary<string, string> CustomFieldNameProperties { get; }

Property Value

Dictionary<string, string>

Model properties that have an explicitly set field name.

ForeignKeys

Dictionary<string, IForeignKey> ForeignKeys { get; }

Property Value

Dictionary<string, IForeignKey>

Model's foreign keys.

ModelProperties

PropertyInfo[] ModelProperties { get; }

Property Value

PropertyInfo[]

Model's properties.

PrimaryCompositeKeys

List<IOrpheusBaseCompositeKeyAttribute> PrimaryCompositeKeys { get; }

Property Value

List<IOrpheusBaseCompositeKeyAttribute>

Model's composite primary keys.

PrimaryKeys

Dictionary<string, IPrimaryKey> PrimaryKeys { get; }

Property Value

Dictionary<string, IPrimaryKey>

Model's primary keys.

SQLName

string SQLName { get; }

Property Value

string

Model's SQLName. Defaults to the model's type name.

SQLServerSchemaName

string SQLServerSchemaName { get; }

Property Value

string

SQL server's schema name.

SchemaIgnoreProperties

List<string> SchemaIgnoreProperties { get; }

Property Value

List<string>

Model properties that are not part of the schema.

UniqueCompositeKeys

List<IOrpheusBaseCompositeKeyAttribute> UniqueCompositeKeys { get; }

Property Value

List<IOrpheusBaseCompositeKeyAttribute>

Model's composite unique keys.

UniqueKeys

Dictionary<string, IUniqueKey> UniqueKeys { get; }

Property Value

Dictionary<string, IUniqueKey>

Model's unique keys.

Methods

CreateInstance<T>()

Creates an instance of the model and typecasts it to the given type.

T CreateInstance<T>()

Returns

T

Type Parameters

T

Type to cast the model

CreateSchemaFields(ISchemaDataObject)

Creates schema fields and constraints for a model.

void CreateSchemaFields(ISchemaDataObject schemaObj)

Parameters

schemaObj ISchemaDataObject

GetAlterDDLCommands(ISchemaDataObject, IOrpheusDDLHelper)

Creates a list of SQL ALTER commands, based on the differences between the current version of the model and the current version of the corresponding db table.

List<string> GetAlterDDLCommands(ISchemaDataObject schemaObj, IOrpheusDDLHelper ddlHelper)

Parameters

schemaObj ISchemaDataObject
ddlHelper IOrpheusDDLHelper

Returns

List<string>

GetFieldNameForProperty(PropertyInfo)

Helper function that returns the corresponding field name for a property.

string GetFieldNameForProperty(PropertyInfo prop)

Parameters

prop PropertyInfo

Returns

string

IsSchemaProperty(PropertyInfo)

Helper function that returns true if the property is not actually part of the schema.

bool IsSchemaProperty(PropertyInfo property)

Parameters

property PropertyInfo

Returns

bool