does anybody know if it’s possible to query an sql server with my own query?
I can't find any information, that I can get to work, so perhaps there is something else I'm missing?
I have tried a LOT of samples from different websites, so it's for the lack of trying (I'm new to ef (and ef core)) I would like to write a sql to call a database function that for some reason is not part of the database scaffolding I have added the following nuget packages (I don’t think I’m missing any?)
PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.6" />
PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="6.0.6" />
PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="6.0.6" />
PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.6">
PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.6" />
PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.6" />
PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.6">
I have run dotnet tool install --global dotnet-ef
(Hours spend on scaffolding not working, before I ran that command)
I used the following to scaffold dotnet ef dbcontext scaffold "Data Source=myservername;Initial Catalog=mydbname; Persist Security Info=True;User ID=myuserid;Password='mypassword'" Microsoft.EntityFrameworkCore.SqlServer --output-dir Models
It generates fine into models folder But who do I write a "raw" query, so I can use the db function?