It is quite subjectical, but for me:
Is it okay if I let Order class create it's own detail? Or should it
be property injected as well?
What do you mean by create it's own detail? A new detail object should has an input (from UI) or should be retrieved from a storage (repository). That way, I prefer to keep the Detail to be injected instead of created in the Order class; and being created in the UI or repository, or a business class responsible for it.
When I wanted to save my order form, should Presentation layer or
Business layer who populates the Order detail?
It depends, whether the creation of Order detail object has specific rule or not. If not, then I prefer to create the Order class with the detail, and let the Business Layer do the validation. If it need a specific logic (such as you set value A to property A, if value 1 is set to property B), keep it in business logic, or create a builder pattern for it.
If Business layer only sends a complete object for repository to save,
then Business layer should be able to create a new Order object? Or is
there another way to manage transient object creation with DI in mind?
It is the same as my answer above. The main point of dependency injection is to keep the logics in such a modular way, so it can be reused, and standardized. If you think it is need a specific-reuseable logic in object creation (Detail) then you need to create a Service object for it. Otherwise, it is better to leave the creation in other layer (UI).
Other things to note:
Are you really sure to use List<T> as Detail data type? It will limit the implementation of detail object to a mere List<T>. If sometimes the logic want to use Array instead, it will need another configuration to the object. I prefer to use IEnumerable<T> instead and use List<T> in private if I need to do on the run insert.
EDIT:
Seems like the user want to know how to handle the object creation. I will explain it from the simplest to the safest.
Simplest --> UI level, assume using C# winform:
public void ButtonAddGoods_Click(){
Goods newGood = new Goods();
newGood.Id = txtProductId.Text;
newGood.Description = txtProductDescription.Text;
newGood.Price = txtProductPrice.Text;
this.Order.AddNewGood(newGood);
}
The safest (IMHO):
public class GoodBuilder{
public Goods CreateGood(){
if(string.IsEmpty(this.Id)) Throw new NullReferenceException("Goods Id is not set");
//additional validation
Goods newGood = new Goods();
newGood.Id = txtProductId.Text;
newGood.Description = txtProductDescription.Text;
newGood.Price = txtProductPrice.Text;
return newGood;
}
}
public void ButtonAddGoods_Click(){
GoodBuilder builder = new GoodBuilder();
builder.Id = this.Id;
builder.Description = this.Description;
builder.Price = this.Price;
this.Order.AddNewGood(builder.CreateGood());
}