예제 #1
0
        public MySmo.View GetView(Smo.View smo_v, MySmo.Database parent = null)
        {
            #region implement

            SetDataLimit();

            var mysmo_v = new MySmo.View();
            mysmo_v.ParentDatabase     = parent;
            mysmo_v.Name               = smo_v.Name;
            mysmo_v.Schema             = smo_v.Schema;
            mysmo_v.CreateTime         = smo_v.CreateDate;
            mysmo_v.Owner              = smo_v.Owner;
            mysmo_v.TriggersCount      = smo_v.Triggers.Count;
            mysmo_v.ExtendedProperties = GetExtendProperties(mysmo_v, smo_v.ExtendedProperties);
            var s = "";
            if (mysmo_v.ExtendedProperties.TryGetValue(K_MS_Description, out s))
            {
                mysmo_v.Description = s;
                mysmo_v.ExtendedProperties.Remove(K_MS_Description);
            }
            mysmo_v.Columns = new List <MySmo.Column>();
            foreach (Smo.Column smo_c in smo_v.Columns)
            {
                var mysmo_c = new MySmo.Column
                {
                    ParentDatabase    = parent,
                    ParentTableBase   = mysmo_v,
                    Name              = smo_c.Name,
                    DataType          = GetDataType(smo_c),
                    Computed          = smo_c.Computed,
                    ComputedText      = smo_c.ComputedText,
                    Default           = smo_c.Default,
                    Identity          = smo_c.Identity,
                    IdentityIncrement = smo_c.IdentityIncrement,
                    IdentitySeed      = smo_c.IdentitySeed,
                    InPrimaryKey      = smo_c.InPrimaryKey,
                    IsForeignKey      = smo_c.IsForeignKey,
                    Nullable          = smo_c.Nullable,
                    RowGuidCol        = smo_c.RowGuidCol
                };
                mysmo_v.Columns.Add(mysmo_c);
            }
            FormatExtendProperties(mysmo_v);

            return(mysmo_v);

            #endregion
        }
예제 #2
0
 public void FormatExtendProperties(MySmo.View mysmo_v)
 {
     CombineExtendProperties(mysmo_v.ExtendedProperties);
     DistributeExtendProperties((MySmo.ITableBase)mysmo_v);
 }