示例#1
0
        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);
        }
示例#2
0
 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);
 }
示例#3
0
 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);
 }