SqlParameterOption's
methods can all be instance methods that returns the same object:
class SqlParameterOption
{
public SqlParameterOption Precision(int p) {/* ... */; return this;}
public SqlParameterOption Substitute() {/* ... */; return this;}
/* ... */
}
/* ... */
SqlParameter.Int32(":ID", 1234).With(new SqlParameterOption()
.Precision(15)
.Substitute());
Re: building up state to be applied later vs. applying directly with each call, if there's no real irreverisible side-effects in either case, then it doesn't matter and it's up to your personal taste. If the options are commited with each method call and there's a chance you might want to undo that, then you might want to build up the state first and then apply it. If the parameter object does validation between properties for you as you apply them then it might be better to go with direct application so you'll get validation feedback right way.