C
C#13mo ago
barcode

✅ Issues with method not being available

Hello, I'm running latest version of .NET and latest version of EF Core and i'm trying to use bulk operations. https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/whatsnew#executeupdate-and-executedelete-bulk-updates The issue arrives when I try to call one of the new functions, they are not present in the definitions. Am I doing something wrong?
What's New in EF Core 7.0
Overview of new features in EF Core 7.0
19 Replies
barcode
barcode13mo ago
barcode
barcode13mo ago
barcode
barcode13mo ago
I'm using rider running on linux
@arch ~ $ dotnet --version
7.0.105
@arch ~ $ dotnet --version
7.0.105
Pobiega
Pobiega13mo ago
your dotnet --version isn't relevant to what version your project is using show your .csproj file instead @barcode
barcode
barcode13mo ago
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\GymRadar.Domain\GymRadar.Domain.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="AutoMapper" Version="12.0.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageReference Include="FluentValidation" Version="11.5.2" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.5.2" />
<PackageReference Include="MediatR" Version="12.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.9" />
</ItemGroup>

<ItemGroup>
<Folder Include="Features\Chains\Centers\Queries\" />
<Folder Include="Features\Chains\Specific\Commands\" />
<Folder Include="Features\Chains\Specific\Queries\" />
<Folder Include="Features\Shared\" />
<Folder Include="Features\Users\Centers\" />
<Folder Include="Features\Users\Specific\" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\GymRadar.Domain\GymRadar.Domain.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="AutoMapper" Version="12.0.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageReference Include="FluentValidation" Version="11.5.2" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.5.2" />
<PackageReference Include="MediatR" Version="12.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.9" />
</ItemGroup>

<ItemGroup>
<Folder Include="Features\Chains\Centers\Queries\" />
<Folder Include="Features\Chains\Specific\Commands\" />
<Folder Include="Features\Chains\Specific\Queries\" />
<Folder Include="Features\Shared\" />
<Folder Include="Features\Users\Centers\" />
<Folder Include="Features\Users\Specific\" />
</ItemGroup>

</Project>
sorry went to take some food 7.0.9 ef core, .net 7.0
Pobiega
Pobiega13mo ago
okay, thats fine. showe your usings in the file you are trying to use the methods in you need the using Microsoft.EntityFrameworkCore; to show those extensions
barcode
barcode13mo ago
it's included maybe it is because i am using postgres? but I checked their site and it says supported
Pobiega
Pobiega13mo ago
are all the projects in the dependency-chain using EF 7.x? it shouldn't be pinning to 6, but it could nah postgre should be fine
barcode
barcode13mo ago
Yes, all use same version I made sure to update them all from 7.0.5 to 7.0.9 while i was trying to debug this
Pobiega
Pobiega13mo ago
hm okay my sample app also uses 7.0.9 and it works fine, also in Rider
barcode
barcode13mo ago
oh good idea let me try to create a new project
Pobiega
Pobiega13mo ago
👍
barcode
barcode13mo ago
and see if it detects sec could u give me the source if it is a 1 pager
Pobiega
Pobiega13mo ago
its not. its a console app with a business dispatcher, migrations, configurations and stuff :p
using EFTestApp;
using EFTestApp.Data;
using Mediator;
using Microsoft.Extensions.Hosting;
using Serilog;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;

Log.Logger = new LoggerConfiguration()
.WriteTo.Console()
.MinimumLevel.Debug()
.CreateLogger();

var host = Host
.CreateDefaultBuilder()
.ConfigureServices(services =>
{
services.AddScoped(typeof(IPipelineBehavior<,>), typeof(TransactionBehavior<,>));
services.AddMediator(o => o.ServiceLifetime = ServiceLifetime.Scoped);

services.AddDbContext<TestAppContext>(x =>
x.UseSqlite(@"Data Source=D:\Code\temp\EFTestApp\EFTestApp\sqlite.db;"));

services.AddTransient<TestApp>();
})
.UseSerilog((ctx, lc) => lc.WriteTo.Console())
.Build();

var app = host.Services.GetRequiredService<TestApp>();

await app.Run();
using EFTestApp;
using EFTestApp.Data;
using Mediator;
using Microsoft.Extensions.Hosting;
using Serilog;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;

Log.Logger = new LoggerConfiguration()
.WriteTo.Console()
.MinimumLevel.Debug()
.CreateLogger();

var host = Host
.CreateDefaultBuilder()
.ConfigureServices(services =>
{
services.AddScoped(typeof(IPipelineBehavior<,>), typeof(TransactionBehavior<,>));
services.AddMediator(o => o.ServiceLifetime = ServiceLifetime.Scoped);

services.AddDbContext<TestAppContext>(x =>
x.UseSqlite(@"Data Source=D:\Code\temp\EFTestApp\EFTestApp\sqlite.db;"));

services.AddTransient<TestApp>();
})
.UseSerilog((ctx, lc) => lc.WriteTo.Console())
.Build();

var app = host.Services.GetRequiredService<TestApp>();

await app.Run();
barcode
barcode13mo ago
👍 create a new test creating* mediator cool i like
Pobiega
Pobiega13mo ago
specifically the source-gen version 🙂
barcode
barcode13mo ago
😮
barcode
barcode13mo ago
i will debug more, will find thei ssue was missing .Relational in my Application layer 😄
Pobiega
Pobiega13mo ago
Great 🙂
Want results from more Discord servers?
Add your server
More Posts
✅ Content of .txt into LabelHello, I'm a beginner with C#, actualy i'm trying to past the content of a txt file into a Label or ❔ Blazor generic component "Type or namespace could not be found"Hello, In my blazor app, i have a generic component (with the use of `@typeparam T`). I have a page ❔ System.IO.FileLoadException for Microsoft.SqlServer.TypesI am working on an old project (.net 4.8) and updating the dependencies. One of these is `Microsoft.❔ blazor wont build from solution template riderhello everyone 🙂 noob here, i've been building blazor webassembly apps for a week it's been fine aASP.NET JSON conversion issuesHello, for some reason asp.net is not serializing my response object correctly, in my request I retu❔ Blazor - Event executed more than onceIt’s the first time I’m asking something on the net, so sorry if the formatting or the way the answe❔ Output from a command line app has extra characters when redirected to my applicationhere is the redirected output. It has these weird characters that are underlined. When running the c✅ Difficulty understanding Inheritance and where to use ConstructorHello people. I'm learning OOP and I've come across this problem. I'm creating a Football team creat❔ Linking folder from one project to anotherHi, i wanted to link folder from one project to another i accomplished it but i can't create new fil✅ Is it correct to use threads now?I read in book following: > as soon as you type new Thread(), it`s over; your project already have l