Example #1
0
        private static CdcTableTypeModel HandleContentDataTableTypeDataModifier(CdcTableTypeModel prevInSortOrder, CdcTableTypeModel nextInSortOrder)
        {
            var result = Mapper.Map <CdcTableTypeModel, CdcTableTypeModel>(nextInSortOrder);

            if (result.Action == E.CdcOperationType.Update)
            {
                if (prevInSortOrder.Action == E.CdcOperationType.Insert)
                {
                    result.Action = E.CdcOperationType.Insert;
                }

                if (prevInSortOrder.Action == E.CdcOperationType.Insert || prevInSortOrder.Action == E.CdcOperationType.Update)
                {
                    foreach (var col in prevInSortOrder.Entity.Columns)
                    {
                        if (!result.Entity.Columns.ContainsKey(col.Key))
                        {
                            result.Entity.Columns.Add(col);
                        }
                    }
                }
            }

            return(result);
        }
Example #2
0
        private static CdcTableTypeModel HandleSimpleTableTypeDataModifier(CdcTableTypeModel prevInSortOrder, CdcTableTypeModel nextInSortOrder)
        {
            var result = Mapper.Map <CdcTableTypeModel, CdcTableTypeModel>(nextInSortOrder);

            if (result.Action == E.CdcOperationType.Update && prevInSortOrder.Action == E.CdcOperationType.Insert)
            {
                result.Action = E.CdcOperationType.Insert;
            }

            return(result);
        }