I am using Python.NET to load a C # assembly to invoke C # code from Python. This works pretty cleanly, however I am having a problem calling a method that looks like this:
Method inside Our.Namespace.Proj.MyRepo:
OutputObject GetData(string user, int anID, int? anOptionalID= null)
I can call the method for the case when an additional third argument is present, but I cannot understand what to pass to the third argument so that it corresponds to the zero case.
import clr
clr.AddReference("Our.Namespace.Proj")
import System
from Our.Namespace.Proj import MyRepo
_repo = MyRepo()
_repo.GetData('me', System.Int32(1), System.Int32(2))
_repo.GetData('me', System.Int32(1))
_repo.GetData('me', System.Int32(1), None)
iPython Notebook indicates that the last argument must be of type:
System.Nullable`1[System.Int32]
Just not sure how to create an object that matches the Null case.
, Null? , Python None , .