You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
API/src/StubbedContextLib/DataSourceStubbedContext.cs

29 lines
1.1 KiB

using DbContextLib;
using Entities;
using Microsoft.EntityFrameworkCore;
namespace StubbedContextLib;
public class DataSourceStubbedContext : AthleteStubbedContext
{
public DataSourceStubbedContext()
:base()
{ }
public DataSourceStubbedContext(DbContextOptions<LibraryContext> options)
:base(options)
{ }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<DataSourceEntity>().HasData(
new DataSourceEntity { IdSource = 1, Type = "Smartwatch", Modele = "Garmin", Precision = 0.5f },
new DataSourceEntity { IdSource = 2, Type = "Smartwatch", Modele = "Polar", Precision = 0.5f },
new DataSourceEntity { IdSource = 3, Type = "Smartwatch", Modele = "Suunto", Precision = 0.5f },
new DataSourceEntity { IdSource = 4, Type = "Smartwatch", Modele = "Fitbit", Precision = 0.5f },
new DataSourceEntity { IdSource = 5, Type = "Smartwatch", Modele = "Apple Watch", Precision = 0.5f }
);
}
}