Hi,
I am using VB.NET and PostgreSQL. When I add an SP to my model as a method, is there a way that the parameters of this method be given default values? Or is there a way to have nullable values have their default value set to Nothing?
Right now, as far as I'm aware, if I call a method on my context object I have to specify each parameter as Nothing, rather than the parameters being Nothing unless specified otherwise (and therefore falling back to the default value set in the SP).
Is there a way to achieve this?
Many thanks,
Peter
Default values for parameters of SP methods.
-
- Posts: 13
- Joined: Fri 03 Jan 2014 11:13
Re: Default values for parameters of SP methods.
Unfortunately, there is no way at the moment.peterharris wrote: Is there a way to achieve this?
If you have any further questions, feel free to contact us.
-
- Posts: 13
- Joined: Fri 03 Jan 2014 11:13
Re: Default values for parameters of SP methods.
OK, my solution at the moment is to set the method as protected internal and extend the context class using a partial class, and create a public method with optional parameters and their defaults set to nulls, which in turn calls the protected method generated by Entity Developer and returns the IQueryable object.
It's a little messy, and a way to do this from within Entity Developer would be better, but I can see how this would not be as easy to implement as it seems (because, e.g., all parameters specified after an optional parameter need to be optional with default values also, etc.).
It's a little messy, and a way to do this from within Entity Developer would be better, but I can see how this would not be as easy to implement as it seems (because, e.g., all parameters specified after an optional parameter need to be optional with default values also, etc.).