예제 #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);
 }