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

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
marton
Posts: 6
Joined: Fri 06 Apr 2018 11:58

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

Post by marton » Mon 16 Apr 2018 14:39

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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

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

Post by Shalex » Wed 18 Apr 2018 17:31

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.

marton
Posts: 6
Joined: Fri 06 Apr 2018 11:58

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

Post by marton » Fri 20 Apr 2018 08:49

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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

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

Post by Shalex » Tue 24 Apr 2018 18:35

The bug is fixed. We will notify you when the new public build of Entity Developer is available for download.

marton
Posts: 6
Joined: Fri 06 Apr 2018 11:58

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

Post by marton » Wed 25 Apr 2018 19:33

Great news. Thank you very much.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

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

Post by Shalex » Fri 27 Apr 2018 10:34

The bug with detecting INT stored procedure parameters in EF Core is fixed (SQL Server): viewtopic.php?f=32&t=37084.

Post Reply