Esempio n. 1
0
		public LineItem LineItem_ForOrderAndProduct( Order order, Product product )
		{
			LineItem lineItem = LineItem_ForOrder( order );
			lineItem.Product = product;
			return lineItem;
		}
Esempio n. 2
0
		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;
		}
Esempio n. 3
0
		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();
		}