Open hherzl opened 1 year ago
In order to use AddColumnForTables extension method, there is a hack:
AddColumnForTables
dynamic importBag = new ExpandoObject(); importBag.ExtendedProperties = new List<ExtendedProperty>(); db.AddColumnForTables(new Column { Name = "Active", Type = "bit", ImportBag = importBag }); db.AddColumnForTables(new Column { Name = "CreationUser", Type = "nvarchar", Length = 50, ImportBag = importBag }); db.AddColumnForTables(new Column { Name = "CreationDateTime", Type = "datetime", ImportBag = importBag }); db.AddColumnForTables(new Column { Name = "LastUpdateUser", Type = "nvarchar", Length = 50, Nullable = true, ImportBag = importBag }); db.AddColumnForTables(new Column { Name = "LastUpdateDateTime", Type = "datetime", Nullable = true, ImportBag = importBag }); db.AddColumnForTables(new Column { Name = "Version", Type = "rowversion", Nullable = true, ImportBag = importBag });
This is a suggested fix for ImportBag property definition in Column class:
ImportBag
Column
[XmlIgnore] public dynamic ImportBag { get { if (m_importBag == null) { m_importBag = new ExpandoObject(); m_importBag.ExtendedProperties = new List<ExtendedProperty>(); } return m_importBag; } set { m_importBag = value; } }
In order to use
AddColumnForTables
extension method, there is a hack:This is a suggested fix for
ImportBag
property definition inColumn
class: