Exemplo n.º 1
0
        private void AddRow(object entity)
        {
            var type = entity.GetType();

            var columnValues = ConventionReader.GetColumnValues(entity);
            var row          = new Row(columnValues);

            EnsureTable(type);

            Table(type).AddRow(row);
        }
Exemplo n.º 2
0
        public int Update <T>(QueryExpression queryExpression, IDictionary <PropertyInfo, object> setters)
        {
            var tableName        = _conventionReader.GetTableName <T>();
            var columnSetters    = _conventionReader.GetColumnValues <T>(setters);
            var primaryKeyColumn = _conventionReader.GetPrimaryKeyColumnName <T>();

            var command = _sqlGenerator.CreateUpdateCommand(tableName, queryExpression.Translate(_conventionReader), columnSetters);

            return(_dbCommandExecutor.ExecuteNonQuery(command, ConnectionString));
        }