ErikEJ / EFCorePowerTools

Entity Framework Core Power Tools - reverse engineering, migrations and model visualization in Visual Studio & CLI
MIT License
2.16k stars 295 forks source link

Map Geometry type in func and stored procedures #1368

Closed Dimigergo closed 2 years ago

Dimigergo commented 2 years ago

In issue #1349 the "Geometry" type is corrent not, but the using NetTopologySuite.Geometries; line is missing.

EF Core Power Tools: 2.5.966

Sample project is the same: EFCore5Geography.zip

bngapiusr commented 2 years ago

I'm trying to use EF Core Power Tools version: 2.5.966 to reverse engineer Northwind db but I'm not getting any results when I call the store procedure.

       using (var db = new NorthwindDbContext())
        {

            var orders = await db.Procedures().CustOrderHistAsync("ALFKI");

            foreach (var order in orders)
                Console.WriteLine($"{order.ProductName}: {order.Total}");
          }

I'm following the example in the docs. I noticed the examples has
var orders = await db.GetProcedures().CustOrderHist("ALFKI") and not the async method
db.Procedures().CustOrderHistAsync("ALFKI") that I'm using above. The generated code only provide the async option so I don't know what I'm missing here.

I'm using EF Core 5.16 and I tested it in VS2019 and VS2022.

Thank you!

ErikEJ commented 2 years ago

The docs probably need an Update

Does the call error? Do you have any data in the table?

bngapiusr commented 2 years ago

no errors and I have data in the table. I tested the store procedure in ssms and I got some data back.

ErikEJ commented 2 years ago

@bngapiusr You a posting in a completely unrelated issue !?

ErikEJ commented 2 years ago

@Dimigergo Where is it missing?

bngapiusr commented 2 years ago

oh sorry about that. I'll create a new issue.

Dimigergo commented 2 years ago

@Dimigergo Where is it missing?

The top of the generated func or sp .cs. It generates the file with Geometry type, but no using NTS at the top.

Dimigergo commented 2 years ago

This is the generated file:

usingError

ErikEJ commented 2 years ago

Thanks.

ErikEJ commented 2 years ago

@Dimigergo Fixed in latest daily build