У меня проблема с использованием двух пакетов с одинаковым именем, начинающихся в классе.
В классе
Мой .csproj
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.1.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.10" />
</ItemGroup>
.FromSqlRaw не распознается
var books = _context.wnag
.FromSqlRaw<wnag>("EXEC Wnag_InsertFromXml @OrderNumber = {0}", wnag.WnagOrderNumber)
.ToList();
Я получаю ошибку
Severity Code Description Project File Line Suppression State
Error CS1061 'DbSet<wnag>' does not contain a definition for 'FromSqlRaw' and no accessible
extension method 'FromSqlRaw' accepting a first argument of type 'DbSet<wnag>' could be found (are
you missing a using directive or an assembly reference?) Project
xyzwnagsController.cs 168 Active