Page 1 of 1

Modeler Generates string member for INT input params for SQL Server SP

Posted: Mon 16 Apr 2018 14:39
by marton
We really love this tool, but it makes our life difficult that it is always replacing the int input parameters for stored procedures to string C# type. When I update the model from the database, it replaces on all methods (Stored Procedures).

Here's a simple SP:

Code: Select all

ALTER PROCEDURE [dbo].[usp_GetBooking] 
	@BookingRef int
AS
...
In the Method Editor the parameter will look like this:

Image

I have to manually change the "Data Type" to Int32. Maybe we do something wrong. But it is really annoying.

Re: Modeler Generates string member for INT input params for SQL Server SP

Posted: Wed 18 Apr 2018 17:31
by Shalex
You are using the newest (6.2.468) build of Entity Developer, aren't you?

We can reproduce the described issue only with Create Model Wizard (investigating the case).

Update Model From Database detects the Int32 parameter correctly.

Re: Modeler Generates string member for INT input params for SQL Server SP

Posted: Fri 20 Apr 2018 08:49
by marton
Yes, we are using the same version.
Maybe it could be important, we are using the VS integrated version.
I just checked what's happening.
So, you don't have to update the model anyhow. It is enough to open the efml file from Visual Studio 2017 and all the methods will be defaulted to String.

To reproduce I am doing the following:
1. First I set the property data type to Int32 and save it.
2. Check the DbContext, it looks good. We have the int parameter in the method.
3. Double click on EFML file, the modeler opens up.
4. Open the "Methods" node in Model Explorer.
5. All the methods parameters are reverted to String.
6. Move a model box to trigger model change.
7. Save the model.
8. Check the DbContext and the field is string again.

So, this is our problem.

Additional information we are using SQLExpress (version 11.0.7001) for this model.

Re: Modeler Generates string member for INT input params for SQL Server SP

Posted: Tue 24 Apr 2018 18:35
by Shalex
The bug is fixed. We will notify you when the new public build of Entity Developer is available for download.

Re: Modeler Generates string member for INT input params for SQL Server SP

Posted: Wed 25 Apr 2018 19:33
by marton
Great news. Thank you very much.

Re: Modeler Generates string member for INT input params for SQL Server SP

Posted: Fri 27 Apr 2018 10:34
by Shalex
The bug with detecting INT stored procedure parameters in EF Core is fixed (SQL Server): viewtopic.php?f=32&t=37084.