ErikEJ / EFCorePowerTools

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

SP Return Properties not being generated after upgrading to 2.6.140 #2164

Closed tkardaridis closed 8 months ago

tkardaridis commented 8 months ago

Hi all. After upgrading on 2.6.140 and trying to reverse engineer my database, i realize that all the results objects from SPs are empty. See the attached image comparing the previous object with the newly generated from 2.6.140. image

To reproduce the issue that I have, try to reverse engineer a database with SPs that returns data with select statement after executing a few operations. Consider the attached SP SQLQuery1.zip In the end there is a select query that returns data. In previous versions of EF Core Power Tools, a results file was generated as follows: `// This file has been auto generated by EF Core Power Tools. using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema;

nullable enable

namespace RenoptiTrader.Db.Models.Declarations { public partial class AvailabilitiesForecastResult { public int? SiteId { get; set; } public string SiteName { get; set; } = default!; [Column("CurrentAvailability", TypeName = "decimal(18,2)")] public decimal? CurrentAvailability { get; set; } public string? ValueHour { get; set; } } }`

With this version I am getting the following Results file `// This file has been auto generated by EF Core Power Tools. using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema;

nullable enable

namespace RenoptiTrader.Db.Models.DeclarationsSchema { public partial class AvailabilitiesForecastResult { } } `

Provide technical details

ErikEJ commented 8 months ago

Could you check the Extensions output window for any message?

tkardaridis commented 8 months ago

You were so right. There was an error in SPs. Someone changed a column name but he didn't alter the SPs to change it there also. Thanks a lot. For your information: On reverse engineering when index exists the attribute Index is red underlined because there is an ambiguous between System.ComponentModel.DataAnnotations.Schema.IndexAttribute and Microsoft.EntityFrameworkCore.IndexAttribute. The last one is correct but I have to pass all the files to set it implicitly to fix the error and compile the project.

Thanks again for your help,

On Thu, Feb 15, 2024 at 4:42 PM Erik Ejlskov Jensen < @.***> wrote:

Could you check the Extensions output window for any message?

— Reply to this email directly, view it on GitHub https://github.com/ErikEJ/EFCorePowerTools/issues/2164#issuecomment-1946236019, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJURUUUXD3X2WCGYCJKDSF3YTYNGTAVCNFSM6AAAAABDKMEKZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBWGIZTMMBRHE . You are receiving this because you authored the thread.Message ID: @.***>

ErikEJ commented 8 months ago

Feel free to create an issue gor the index attribute issue