protected virtual IList <string> GetColumnNameListFromUpdateOfModel(UpdateOfModel <T> updateOf) { var updateOfList = new List <string>(); if (updateOf != null && updateOf.Count() > 0) { foreach (var propertyInfo in updateOf.GetPropertiesInfos()) { var attribute = propertyInfo.GetCustomAttribute(typeof(ColumnAttribute)); if (attribute != null) { var dbColumnName = ((ColumnAttribute)attribute).Name; updateOfList.Add(dbColumnName); } else { updateOfList.Add(propertyInfo.Name); } } } return(updateOfList); }
protected TableDependency(string connectionString, string tableName, ModelToTableMapper <T> mapper, UpdateOfModel <T> updateOf, DmlTriggerType dmlTriggerType, bool automaticDatabaseObjectsTeardown, string namingConventionForDatabaseObjects = null) { this.TableDependencyCommonSettings(connectionString, tableName); this.Initializer(connectionString, tableName, mapper, this.GetColumnNameListFromUpdateOfModel(updateOf), dmlTriggerType, automaticDatabaseObjectsTeardown, namingConventionForDatabaseObjects); }
protected TableDependency(string connectionString, string tableName, ModelToTableMapper <T> mapper, UpdateOfModel <T> updateOf, DmlTriggerType dmlTriggerType) { this.TableDependencyCommonSettings(connectionString, tableName); this.Initializer(connectionString, tableName, mapper, this.GetColumnNameListFromUpdateOfModel(updateOf), dmlTriggerType); }