public LineItem LineItem_ForOrderAndProduct( Order order, Product product ) { LineItem lineItem = LineItem_ForOrder( order ); lineItem.Product = product; return lineItem; }
public TestDatabase Add( Product product ) { // Exit if null or if this has already been added. if ( _products.AddIfUnique( product, x => x.Id == product.Id ) ) { // Add parents. // Add children. } return this; }
public void Insert( Product product ) { IDbCommand command = _session.CreateCommandWithinCurrentTransaction(); command.CommandText = SqlGenerator.GenerateInsertSql( "Product", new[] { "Id", "Name", "Description" }, // HasIdentityColumn ); HasNoIdentityColumn ); command.SetParameter( "@Id", product.Id ); command.SetParameter( "@Name", product.Name ); command.SetParameter( "@Description", product.Description ); LogCommand( command ); command.ExecuteNonQuery(); }