//----------------------------------------------------------------------- // FILENAME: FriendshipStubbedContext.cs // PROJECT: StubbedContextLib // SOLUTION: HeartTrack // DATE CREATED: 22/02/2024 // AUTHOR: Antoine PEREDERII //----------------------------------------------------------------------- using DbContextLib; using Entities; using Microsoft.EntityFrameworkCore; namespace StubbedContextLib { /// /// Represents the stubbed context for friendship entities. /// public class FriendshipStubbedContext : DataSourceStubbedContext { /// /// Initializes a new instance of the class. /// public FriendshipStubbedContext() : base() { } /// /// Initializes a new instance of the class with the specified options. /// /// The options for the context. public FriendshipStubbedContext(DbContextOptions options) : base(options) { } /// /// Configures the model for the heart rate stubbed context. /// /// The model builder instance. protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity().HasData( new FriendshipEntity { FollowerId = 1, FollowingId = 2 }, new FriendshipEntity { FollowerId = 1, FollowingId = 3 }, new FriendshipEntity { FollowerId = 3, FollowingId = 1 } ); } } }