@@ -28,8 +28,6 @@ public sealed class PersistRequest
2828
2929 public IEnumerable < PersistParameterBinding > ParameterBindings { get ; private set ; }
3030
31- internal NodeConfiguration NodeConfiguration { get ; private set ; }
32-
3331 public SqlCompilationResult GetCompiledStatement ( )
3432 {
3533 if ( compiledStatement == null )
@@ -50,10 +48,21 @@ public void Prepare()
5048
5149 public PersistRequest (
5250 StorageDriver driver , SqlStatement statement , IEnumerable < PersistParameterBinding > parameterBindings )
53- : this ( driver , statement , parameterBindings , null )
5451 {
52+ ArgumentValidator . EnsureArgumentNotNull ( driver , "driver" ) ;
53+ ArgumentValidator . EnsureArgumentNotNull ( statement , "statement" ) ;
54+
55+ var compileUnit = statement as ISqlCompileUnit ;
56+ if ( compileUnit == null )
57+ throw new ArgumentException ( "Statement is not ISqlCompileUnit" ) ;
58+
59+ this . driver = driver ;
60+ Statement = statement ;
61+ CompileUnit = compileUnit ;
62+ ParameterBindings = ParameterBinding . NormalizeBindings ( parameterBindings ) ;
5563 }
5664
65+ [ Obsolete ]
5766 public PersistRequest (
5867 StorageDriver driver , SqlStatement statement , IEnumerable < PersistParameterBinding > parameterBindings , NodeConfiguration nodeConfiguration )
5968 {
@@ -68,7 +77,6 @@ public PersistRequest(
6877 Statement = statement ;
6978 CompileUnit = compileUnit ;
7079 ParameterBindings = ParameterBinding . NormalizeBindings ( parameterBindings ) ;
71- NodeConfiguration = nodeConfiguration ;
7280 }
7381 }
7482}
0 commit comments