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
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
TType to cast the model
CreateSchemaFields(ISchemaDataObject)
Creates schema fields and constraints for a model.
void CreateSchemaFields(ISchemaDataObject schemaObj)
Parameters
schemaObjISchemaDataObject
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
schemaObjISchemaDataObjectddlHelperIOrpheusDDLHelper
Returns
GetFieldNameForProperty(PropertyInfo)
Helper function that returns the corresponding field name for a property.
string GetFieldNameForProperty(PropertyInfo prop)
Parameters
propPropertyInfo
Returns
IsSchemaProperty(PropertyInfo)
Helper function that returns true if the property is not actually part of the schema.
bool IsSchemaProperty(PropertyInfo property)
Parameters
propertyPropertyInfo