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))); }
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))); }
private void AddAndExecute(IModel model, TransactionChangeType type) { var table = model.Metadata().Table; AddAndExecute(new StateChange(model, table, type)); }
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)); }