1- // Copyright (c) .NET Foundation. All rights reserved. 
1+  // Copyright (c) .NET Foundation. All rights reserved. 
22// Licensed under the MIT License. See License.txt in the project root for license information. 
33
44using  System ; 
@@ -20,9 +20,9 @@ internal class DefaultFunctionExecutionContext : FunctionExecutionContext, IDisp
2020        public  DefaultFunctionExecutionContext ( IServiceScopeFactory  serviceScopeFactory ,  FunctionInvocation  invocation , 
2121            FunctionDefinition  definition ) 
2222        { 
23-             _serviceScopeFactory  =  serviceScopeFactory ; 
24-             Invocation  =  invocation ; 
25-             FunctionDefinition  =  definition ; 
23+             _serviceScopeFactory  =  serviceScopeFactory   ??   throw   new   ArgumentNullException ( nameof ( serviceScopeFactory ) ) ; 
24+             Invocation  =  invocation   ??   throw   new   ArgumentNullException ( nameof ( invocation ) ) ; 
25+             FunctionDefinition  =  definition   ??   throw   new   ArgumentNullException ( nameof ( definition ) ) ; 
2626            OutputBindings  =  new  Dictionary < string ,  object > ( ) ; 
2727        } 
2828
@@ -32,7 +32,7 @@ public DefaultFunctionExecutionContext(IServiceScopeFactory serviceScopeFactory,
3232
3333        public  override  object ?  InvocationResult  {  get ;  set ;  } 
3434
35-         public  override  InvocationLogger  Logger  {  get ;  set ;  } 
35+         public  override  InvocationLogger ?  Logger  {  get ;  set ;  } 
3636
3737        public  override  IDictionary < string ,  object >  OutputBindings  {  get ;  } 
3838
@@ -42,19 +42,16 @@ public override IServiceProvider InstanceServices
4242        { 
4343            get 
4444            { 
45-                 if  ( _instanceServicesScope  ==  null   &&   _serviceScopeFactory   !=   null ) 
45+                 if  ( _instanceServicesScope  ==  null ) 
4646                { 
4747                    _instanceServicesScope  =  _serviceScopeFactory . CreateScope ( ) ; 
4848                    _instanceServices  =  _instanceServicesScope . ServiceProvider ; 
4949                } 
5050
51-                 return  _instanceServices ; 
51+                 return  _instanceServices ! ; 
5252            } 
5353
54-             set 
55-             { 
56-                 _instanceServices  =  value ; 
57-             } 
54+             set  =>  _instanceServices  =  value ; 
5855        } 
5956
6057        public  virtual  void  Dispose ( ) 
0 commit comments