コード例 #1
0
 public bool Equals(ConvertMetadataInputColumn other)
 {
     if (other == null || (this.VirtualColumn != null && other.VirtualColumn == null) || (this.VirtualColumn == null && other.VirtualColumn != null))
     {
         return(false);
     }
     else if (this.VirtualColumn == null && other.VirtualColumn == null)
     {
         return(this.LineageID.Equals(other.LineageID));
     }
     else
     {
         return(VirtualColumn.Equals(other.VirtualColumn));
     }
 }
コード例 #2
0
        public IActionResult AddColumn([FromQuery] long tableId, [FromForm] VirtualColumn column)
        {
            column.VirtualTableId = tableId;

            _context.Set <VirtualColumn>().Add(column);

            foreach (var row in _context.Set <VirtualRow>().Include(c => c.Values)
                     .Include(t => t.Table)
                     .Where(p => p.Table.Id == tableId))
            {
                row.Values.Add(new VirtualValue {
                    Column = column, Value = column.DefaultValue
                });
            }

            _context.SaveChanges();

            return(RedirectToAction("Column", new { id = tableId }));
        }