diff --git a/API_SQLuedo/EntityFramework/InquiryEntity.cs b/API_SQLuedo/EntityFramework/InquiryEntity.cs index f930acf..c77e521 100644 --- a/API_SQLuedo/EntityFramework/InquiryEntity.cs +++ b/API_SQLuedo/EntityFramework/InquiryEntity.cs @@ -1,39 +1,36 @@ -using System.ComponentModel.DataAnnotations; +namespace Entities; -namespace Entities +public class InquiryEntity { - public class InquiryEntity - { - public int Id { get; } - public string Title { get; set; } - public string Description { get; set; } - public bool IsUser { get; set; } - public InquiryTableEntity Database { get; set; } - public SolutionEntity InquiryTable { get; set; } - public InquiryEntity() { } + public int Id { get; } + public string Title { get; set; } + public string Description { get; set; } + public bool IsUser { get; set; } + public InquiryTableEntity Database { get; set; } + public SolutionEntity InquiryTable { get; set; } + public InquiryEntity() { } - public InquiryEntity(int id) - { - Id = id; - } - public InquiryEntity(int id, string title, string description, bool isUser, InquiryTableEntity database, SolutionEntity inquiryTable) - { - Id = id; - Title = title; - Description = description; - IsUser = isUser; - Database = database; - InquiryTable = inquiryTable; - } + public InquiryEntity(int id) + { + Id = id; + } + public InquiryEntity(int id, string title, string description, bool isUser, InquiryTableEntity database, SolutionEntity inquiryTable) + { + Id = id; + Title = title; + Description = description; + IsUser = isUser; + Database = database; + InquiryTable = inquiryTable; + } - public InquiryEntity(string title, string description, bool isUser, InquiryTableEntity database, SolutionEntity inquiryTable) - { - Id = 0; - Title = title; - Description = description; - IsUser = isUser; - Database = database; - InquiryTable = inquiryTable; - } + public InquiryEntity(string title, string description, bool isUser, InquiryTableEntity database, SolutionEntity inquiryTable) + { + Id = 0; + Title = title; + Description = description; + IsUser = isUser; + Database = database; + InquiryTable = inquiryTable; } -} +} \ No newline at end of file diff --git a/API_SQLuedo/EntityFramework/SolutionEntity.cs b/API_SQLuedo/EntityFramework/SolutionEntity.cs index 6c8dbdf..c2aa1ee 100644 --- a/API_SQLuedo/EntityFramework/SolutionEntity.cs +++ b/API_SQLuedo/EntityFramework/SolutionEntity.cs @@ -41,4 +41,13 @@ public class SolutionEntity MurderWeapon = murderWeapon; Explanation = explanation; } + public SolutionEntity(int ownerId, string murdererFirstName, string murdererLastName, string murderPlace, string murderWeapon, string explanation) + { + OwnerId = ownerId; + MurdererFirstName = murdererFirstName; + MurdererLastName = murdererLastName; + MurderPlace = murderPlace; + MurderWeapon = murderWeapon; + Explanation = explanation; + } } \ No newline at end of file diff --git a/API_SQLuedo/StubbedContextLib/StubbedContext.cs b/API_SQLuedo/StubbedContextLib/StubbedContext.cs index a833821..6745ede 100644 --- a/API_SQLuedo/StubbedContextLib/StubbedContext.cs +++ b/API_SQLuedo/StubbedContextLib/StubbedContext.cs @@ -1,4 +1,5 @@ -using System.Security.Cryptography; +using System.Runtime.CompilerServices; +using System.Security.Cryptography; using DbContextLib; using Entities; using Microsoft.AspNetCore.Cryptography.KeyDerivation; @@ -46,5 +47,23 @@ public class StubbedContext : UserDbContext prf: KeyDerivationPrf.HMACSHA256, iterationCount: 100000, numBytesRequested: 256 / 8)), "Victor.GABORIT@etu.uca.fr", true)); + + modelBuilder.Entity().HasData( + new InquiryEntity(1, "L'enquête de la carotte", "La description de l'inquiry1", true, null, null), + new InquiryEntity(2, "L'enquête sur les orang outan", "The new description", false, null, null), + new InquiryEntity(3, "L'enquête sur les parapluies", "Il pleuvait", false, null, null)); + + modelBuilder.Entity().HasData( + new InquiryTableEntity(1, "Inquiry1", + "Server=localhost;Database=Inquiry1;Trusted_Connection=True;MultipleActiveResultSets=true"), + new InquiryTableEntity(2, "Inquiry2", + "Server=localhost;Database=Inquiry2;Trusted_Connection=True;MultipleActiveResultSets=true"), + new InquiryTableEntity(3, "Inquiry3", + "Server=localhost;Database=Inquiry3;Trusted_Connection=True;MultipleActiveResultSets=true")); + + modelBuilder.Entity().HasData( + new SolutionEntity(1, "Maxime", "Sapountzis", "La cuisine", "Le couteau", "Parce que c'est Maxime"), + new SolutionEntity(2, "Johnny", "Ratton", "La cuisine", "Le couteau", "Parce que il est ra****"), + new SolutionEntity(3, "Erwan", "Menager", "La salle de bain", "L'arachide", "Parce que c'est Erwan")); } } \ No newline at end of file