コード例 #1
0
ファイル: StateChange.cs プロジェクト: radtek/slim
        public StateChange(IModel model, Table table, TransactionChangeType type)
        {
            Model = model;
            Table = table;
            Type  = type;

            PrimaryKeys = new PrimaryKeys(Table.PrimaryKeyColumns.Select(x => x.ValueProperty.GetValue(Model)));
        }
コード例 #2
0
ファイル: StateChange.cs プロジェクト: bazer/slim
        public StateChange(IModel model, TableMetadata table, TransactionChangeType type)
        {
            if (model == null)
            {
                throw new ArgumentNullException(nameof(model));
            }

            if (table == null)
            {
                throw new ArgumentNullException(nameof(table));
            }

            Model = model;
            Table = table;
            Type  = type;

            PrimaryKeys = new PrimaryKeys(Table.PrimaryKeyColumns.Select(x => x.ValueProperty.GetValue(Model)));
        }
コード例 #3
0
        private void AddAndExecute(IModel model, TransactionChangeType type)
        {
            var table = model.Metadata().Table;

            AddAndExecute(new StateChange(model, table, type));
        }
コード例 #4
0
        private void AddAndExecute(IModel model, TransactionChangeType type)
        {
            var table = DatabaseProvider.Database.Tables.Single(x => x.Model.CsType == model.GetType() || x.Model.ProxyType == model.GetType());

            AddAndExecute(new StateChange(model, table, type));
        }