Use Sqlite Instead of Db in Memory to Verify Foreign Key

How to check check Constrains in test ? Todo: i need to insert some description :D When we need to check check, we need to use Sqlite provider When use providers: using System; using System.Threading.Tasks; using Bogus; using Microsoft.EntityFrameworkCore; using TrackingConsumerService.Data; using TrackingConsumerService.Data.Models; using Xunit; namespace TrackingConsumerService.Test.Fixture { public class DbContextFixture : IDisposable { public MyDbContest DbContext { get; private set; } public DbContextFixture() { var options = new DbContextOptionsBuilder<MyDbContest>() ....

June 15, 2024 · 1 min · Carlo Bertini [WaYdotNET]
#csharp #dotnet