diff --git a/WebApi/DTOs/AdministratorDto.cs b/WebApi/DTOs/AdministratorDto.cs index d417d95..a8057e0 100644 --- a/WebApi/DTOs/AdministratorDto.cs +++ b/WebApi/DTOs/AdministratorDto.cs @@ -13,10 +13,10 @@ namespace DTOs /// define a DTO for an administrator /// properties : /// Id : identifier in the database - /// Username : username for a player - /// HashedPassword : hashed of the password of the player + /// Username : username for a administrator + /// HashedPassword : hash of the password of the administrator /// - public int Id { get; set; } + public int? Id { get; set; } public string Username { get; set; } = null!; public string HashedPassword { get; set; } = null!; } diff --git a/WebApi/DTOs/AnswerDto.cs b/WebApi/DTOs/AnswerDto.cs index 257811c..b26056c 100644 --- a/WebApi/DTOs/AnswerDto.cs +++ b/WebApi/DTOs/AnswerDto.cs @@ -10,9 +10,9 @@ namespace DTOs /// properties : /// Id : identifier in the database /// Content : content of the answer - /// idQuestion : the id of the question which it answer to + /// IdQuestion : the id of the question which it answer to /// - public int Id { get; set; } + public int? Id { get; set; } public string Content { get; set; } = null!; public int? IdQuestion { get; set; } } diff --git a/WebApi/DTOs/ChapterDto.cs b/WebApi/DTOs/ChapterDto.cs index a514ab7..e5c15ca 100644 --- a/WebApi/DTOs/ChapterDto.cs +++ b/WebApi/DTOs/ChapterDto.cs @@ -15,7 +15,7 @@ namespace DTOs /// Id : identifier in the database /// Name : name of the chapter /// - public int Id { get; set; } + public int? Id { get; set; } public string Name { get; set; } = null!; } } diff --git a/WebApi/DTOs/LobbyDto.cs b/WebApi/DTOs/LobbyDto.cs index 9c03514..d8b5e24 100644 --- a/WebApi/DTOs/LobbyDto.cs +++ b/WebApi/DTOs/LobbyDto.cs @@ -18,10 +18,10 @@ namespace DTOs /// Password : password require to access at the lobby /// IdCreator : identifier of the creator player /// - public int Id { get; set; } + public int? Id { get; set; } public string Name { get; set; } = null!; public string Password { get; set; } = null!; public int NbPlayers { get; set; } - public int IdCreator { get; set; } + public int? IdCreator { get; set; } } } diff --git a/WebApi/DTOs/PlayerDto.cs b/WebApi/DTOs/PlayerDto.cs index be06345..d0916c9 100644 --- a/WebApi/DTOs/PlayerDto.cs +++ b/WebApi/DTOs/PlayerDto.cs @@ -13,10 +13,10 @@ namespace DTOs /// define a DTO for a player /// properties : /// Id : identifier in the database - /// Nickname : nickname for a player + /// Nickname : nickname for the player /// HashedPassword : hashed of the password of the player /// - public int Id { get; set; } + public int? Id { get; set; } public string Nickname { get; set; } = null!; public string HashedPassword { get; set; } = null!; } diff --git a/WebApi/DTOs/QuestionDto.cs b/WebApi/DTOs/QuestionDto.cs index c0eb3e4..cc2391f 100644 --- a/WebApi/DTOs/QuestionDto.cs +++ b/WebApi/DTOs/QuestionDto.cs @@ -20,11 +20,11 @@ namespace DTOs /// IdChapter : identifier of the chapter of the question /// IdAnswerGood : identifier of the right answer to this question /// - public int Id { get; set; } + public int? Id { get; set; } public string Content { get; set; } = null!; - public int Difficuty { get; set; } + public int Difficulty { get; set; } public int NbFalls { get; set; } - public int IdChapter { get; set; } - public int IdAnswerGood { get; set; } + public int? IdChapter { get; set; } + public int? IdAnswerGood { get; set; } } } diff --git a/WebApi/DbConnectionLibrairie/MyDbContext.cs b/WebApi/DbConnectionLibrairie/MyDbContext.cs index b3d8914..a5fdb4a 100644 --- a/WebApi/DbConnectionLibrairie/MyDbContext.cs +++ b/WebApi/DbConnectionLibrairie/MyDbContext.cs @@ -5,7 +5,12 @@ namespace DbConnectionLibrairie { public class MyDbContext : DbContext { + public DbSet Administrators { get; set; } public DbSet Answers { get; set; } + public DbSet Chapters { get; set; } + public DbSet Lobbies { get; set; } + public DbSet Players { get; set; } + public DbSet Questions { get; set; } public MyDbContext() { } diff --git a/WebApi/Entities/AdministratorEntity.cs b/WebApi/Entities/AdministratorEntity.cs index 8ee63ac..81b3c9c 100644 --- a/WebApi/Entities/AdministratorEntity.cs +++ b/WebApi/Entities/AdministratorEntity.cs @@ -13,11 +13,11 @@ namespace Entities /// define an entity for an administrator /// properties : /// Id : identifier in the database - /// Username : username for a player - /// HashedPassword : hashed of the password of the player + /// Username : username for a administrator + /// HashedPassword : hash of the password of the administrator /// [Key] - public int Id { get; set; } + public int? Id { get; set; } public string Username { get; set; } = null!; public string HashedPassword { get; set; } = null!; } diff --git a/WebApi/Entities/AnswerEntity.cs b/WebApi/Entities/AnswerEntity.cs index 5395dbc..5178988 100644 --- a/WebApi/Entities/AnswerEntity.cs +++ b/WebApi/Entities/AnswerEntity.cs @@ -10,10 +10,10 @@ namespace Entities /// properties : /// Id : identifier in the database /// Content : content of the answer - /// idQuestion : the id of the question which it answer to + /// IdQuestion : the id of the question which it answer to /// [Key] - public int Id { get; set; } + public int? Id { get; set; } public string Content { get; set; } = null!; [ForeignKey(nameof(QuestionEntity))] diff --git a/WebApi/Entities/ChapterEntity.cs b/WebApi/Entities/ChapterEntity.cs index fa608dd..794579f 100644 --- a/WebApi/Entities/ChapterEntity.cs +++ b/WebApi/Entities/ChapterEntity.cs @@ -16,7 +16,7 @@ namespace Entities /// Name : name of the chapter /// [Key] - public int Id { get; set; } + public int? Id { get; set; } public string Name { get; set; } = null!; } } diff --git a/WebApi/Entities/LobbyEntity.cs b/WebApi/Entities/LobbyEntity.cs index a999e52..15559c7 100644 --- a/WebApi/Entities/LobbyEntity.cs +++ b/WebApi/Entities/LobbyEntity.cs @@ -19,12 +19,12 @@ namespace Entities /// IdCreator : identifier of the creator player /// [Key] - public int Id { get; set; } + public int? Id { get; set; } public string Name { get; set; } = null!; public string Password { get; set; } = null!; public int NbPlayers { get; set; } [ForeignKey(nameof(PlayerEntity))] - public int IdCreator { get; set; } + public int? IdCreator { get; set; } } } diff --git a/WebApi/Entities/PlayerEntity.cs b/WebApi/Entities/PlayerEntity.cs index 9aa0411..dc3d839 100644 --- a/WebApi/Entities/PlayerEntity.cs +++ b/WebApi/Entities/PlayerEntity.cs @@ -13,11 +13,11 @@ namespace Entities /// define an entity for a player /// properties : /// Id : identifier in the database - /// Nickname : nickname for a player + /// Nickname : nickname for the player /// HashedPassword : hashed of the password of the player /// [Key] - public int Id { get; set; } + public int? Id { get; set; } public string Nickname { get; set; } = null!; public string HashedPassword { get; set; } = null!; } diff --git a/WebApi/Entities/QuestionEntity.cs b/WebApi/Entities/QuestionEntity.cs index b01c0d0..1e08922 100644 --- a/WebApi/Entities/QuestionEntity.cs +++ b/WebApi/Entities/QuestionEntity.cs @@ -21,15 +21,15 @@ namespace Entities /// IdAnswerGood : identifier of the right answer to this question /// [Key] - public int Id { get; set; } + public int? Id { get; set; } public string Content { get; set; } = null!; - public int Difficuty { get; set; } + public int Difficulty { get; set; } public int NbFalls { get; set; } [ForeignKey(nameof(ChapterEntity))] - public int IdChapter { get; set; } + public int? IdChapter { get; set; } [ForeignKey(nameof(AnswerEntity))] - public int IdAnswerGood { get; set; } + public int? IdAnswerGood { get; set; } } } diff --git a/WebApi/EntityManagers/AnswerEntityManager.cs b/WebApi/EntityManagers/AnswerEntityManager.cs deleted file mode 100644 index cb5cd7d..0000000 --- a/WebApi/EntityManagers/AnswerEntityManager.cs +++ /dev/null @@ -1,83 +0,0 @@ -using DbConnectionLibrairie; -using Entities; -using ManagerInterfaces; -using Microsoft.EntityFrameworkCore; -using OrderCriterias; -using System.Collections.ObjectModel; - -namespace EntityManagers -{ - /// - /// a manager for answer entity - /// - public class AnswerEntityManager : IAnswerManager - { - private MyDbContext dbContext; - - public int getNbElement() - { - return dbContext.Answers.CountAsync().Result; - } - - public AnswerEntityManager(MyDbContext dbContext) - { - this.dbContext = dbContext; - } - - public AnswerEntity ajouterAnswer(AnswerEntity answer) - { - var tmp = dbContext.Answers.Where(a => a.Equals(answer)).FirstOrDefaultAsync().Result; - if (tmp != null) return tmp; - dbContext.Answers.Add(answer); - dbContext.SaveChangesAsync(); - return dbContext.Answers.Where(a => a.Equals(answer)).FirstAsync().Result; - } - - public IEnumerable getAnswers(int nb, int count, AnswerOrderCriteria orderCriteria = AnswerOrderCriteria.ById) - { - if ((nb - 1) * count >= getNbElement()) throw new Exception("too many page skiped"); - if (orderCriteria == AnswerOrderCriteria.ById) - { - return dbContext.Answers.OrderBy(a => a.Id).Skip((nb - 1) * count).Take(count).ToListAsync().Result; - } - else - { - return dbContext.Answers.OrderBy(a => a.Content).Skip((nb - 1) * count).Take(count).ToListAsync().Result; - } - } - - private AnswerEntity? getAnswer(long id) - { - return dbContext.Answers.Where(a => a.Id == id).FirstOrDefaultAsync().Result; - } - - public AnswerEntity? modifierAnswer(long id, AnswerEntity answer) - { - var tmp = getAnswer(id); - if (tmp == null) return null; - tmp.Content = answer.Content; - dbContext.SaveChangesAsync(); - return tmp; - } - - public AnswerEntity? supprimerAnswer(long id) - { - var tmp = getAnswer(id); - if (tmp == null) return null; - dbContext.Answers.Remove(tmp); - dbContext.SaveChangesAsync(); - return tmp; - } - - public void supprimerAnswer(AnswerEntity answer) - { - dbContext.Answers.Remove(answer); - dbContext.SaveChangesAsync(); - } - - public ReadOnlyCollection? getAnswersByIdQuestion(long id) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/WebApi/ExtensionsClassLibrairie/AnswerExtensionMethods.cs b/WebApi/ExtensionsClassLibrairie/AnswerExtensionMethods.cs index ce9a13c..664d9cb 100644 --- a/WebApi/ExtensionsClassLibrairie/AnswerExtensionMethods.cs +++ b/WebApi/ExtensionsClassLibrairie/AnswerExtensionMethods.cs @@ -62,7 +62,11 @@ namespace ExtensionsClassLibrairie /// the dto answer that correspond public static AnswerDto ToDto(this Answer a) { - return new AnswerDto(a.Content, a.Id); + return new AnswerDto + { + Content = a.Content, + Id = a.Id + }; } /// @@ -72,7 +76,11 @@ namespace ExtensionsClassLibrairie /// the dto answer that correspond public static AnswerDto ToDto(this AnswerEntity a) { - return new AnswerDto(a.Content, a.Id); + return new AnswerDto + { + Content = a.Content, + Id = a.Id + }; } /// diff --git a/WebApi/ManagerInterfaces/IAnswerManager.cs b/WebApi/ManagerInterfaces/IAnswerManager.cs index 758c1c1..538c843 100644 --- a/WebApi/ManagerInterfaces/IAnswerManager.cs +++ b/WebApi/ManagerInterfaces/IAnswerManager.cs @@ -25,7 +25,7 @@ namespace ManagerInterfaces /// this page (or null if (nb-1)*count /// is outside boundaries (0, getNbElement()-1) /// - public Task<(int nbAnswer, IEnumerable? answers)> getAnswers(int nb, int count, AnswerOrderCriteria orderCriteria = AnswerOrderCriteria.ById); + public Task<(int nbAnswers, ReadOnlyCollection? answers)> getAnswers(int nb, int count, AnswerOrderCriteria orderCriteria = AnswerOrderCriteria.ById); /// /// get a T element with an id /// @@ -67,5 +67,14 @@ namespace ManagerInterfaces /// to the id or null if there isn't any /// public Task ajouterAnswer(T answer); + /// + /// get a T element with an id + /// + /// the id of the T element + /// + /// the T element that corresponde + /// to the id or null if there isn't any + /// + public Task getAnswer(long id); } } diff --git a/WebApi/Model/Administrator.cs b/WebApi/Model/Administrator.cs index d325829..23b722f 100644 --- a/WebApi/Model/Administrator.cs +++ b/WebApi/Model/Administrator.cs @@ -5,27 +5,27 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace model +namespace Model { public class Administrator { /// - /// define a DTO for an administrator + /// define an administrator /// attributes : /// id : identifier in the database - /// username : username for a player - /// hashedPassword : hashed of the password of the player + /// username : username for a administrator + /// hashedPassword : hash of the password of the administrator /// private int id; private string? username; - private string hashedPassword; + private string? hashedPassword; /// /// getters and setters for attributes /// public int Id { get => id; - private set { id = value < 0 ? 0 : value; } + private set { id = value < -1 ? -1 : value; } } public string Username { @@ -34,11 +34,17 @@ namespace model } public string HashedPassword { - get => hashedPassword; - set { hashedPassword = value; } + get => hashedPassword == null ? "" : hashedPassword; + set { hashedPassword = value == "" ? null : value; } } - public Administrator(string username, string hashedPassword, int id) + /// + /// constructor of an administrator + /// + /// the username of the administrator + /// the hash of the password of the administrator + /// the id in the database + public Administrator(string username, string hashedPassword, int id = -1) { this.Username = username; this.HashedPassword = hashedPassword; diff --git a/WebApi/Model/Answer.cs b/WebApi/Model/Answer.cs index 01c100d..5525f91 100644 --- a/WebApi/Model/Answer.cs +++ b/WebApi/Model/Answer.cs @@ -1,19 +1,51 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace model +namespace Model { public class Answer { /// - /// define a DTO for an answer for a Question with Mutiple Choice - /// properties : - /// Id : identifier in the database - /// Content : content of the answer + /// define an answer for a Question with Mutiple Choice + /// attributes : + /// id : identifier in the database + /// content : content of the answer /// idQuestion : the id of the question which it answer to /// - public int Id { get; set; } - public string Content { get; set; } = null!; - public int? IdQuestion { get; set; } + private int id; + private string? content; + private int idQuestion; + + /// + /// getters and setters for attributes + /// + public int? Id + { + get => id == -1 ? null : id; // null = no id + private set { id = value < -1 || value == null ? -1 : value.Value; } + } + public string Content + { + get => content == null ? "" : content; + set { content = value == "" ? null : value; } + } + public int? IdQuestion + { + get => idQuestion == -1 ? null : idQuestion; // null = no idQuestion + private set { idQuestion = value < -1 || value == null ? -1 : value.Value; } + } + /// + /// constructor of an answer + /// + /// the content of the answer + /// the id in the database + /// the id of the question which it answer to + public Answer(string content, int? idQuestion = null, int? id = null) + { + Content = content; + Id = id; + IdQuestion = idQuestion; + } + } } diff --git a/WebApi/Model/Chapter.cs b/WebApi/Model/Chapter.cs index bf5cc35..f3bf772 100644 --- a/WebApi/Model/Chapter.cs +++ b/WebApi/Model/Chapter.cs @@ -5,17 +5,41 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace model +namespace Model { public class Chapter { /// /// define a mathematical chapter or thematic - /// properties : - /// Id : identifier in the database - /// Name : name of the chapter + /// attributes : + /// id : identifier in the database + /// name : name of the chapter /// - public int Id { get; set; } - public string Name { get; set; } = null!; + int id; + string? name; + /// + /// getters and setters for attributs + /// + public int? Id + { + get => id == -1 ? null : id ; + private set { id = value == null || value < -1 ? -1 : value.Value; } + } + public string Name + { + get => name == null ? "" : name; + set { name = value == "" ? null : value; } + } + + /// + /// custructor of a mathematical chapter + /// + /// name of the chapter + /// id in the database + public Chapter(string name, int? id = null) + { + Name = name; + Id = id; + } } -} +} \ No newline at end of file diff --git a/WebApi/Model/Lobby.cs b/WebApi/Model/Lobby.cs index 83da300..8624941 100644 --- a/WebApi/Model/Lobby.cs +++ b/WebApi/Model/Lobby.cs @@ -6,22 +6,67 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace model +namespace Model { public class Lobby { /// /// define a lobby for QMC rapidity fight - /// properties : - /// Id : identifier of the lobby in the database - /// Name : name of the lobby - /// Password : password require to access at the lobby + /// attributes : + /// id : identifier of the lobby in the database + /// name : name of the lobby + /// password : password require to access at the lobby /// idCreator : identifier of the creator player /// - public int Id { get; set; } - public string Name { get; set; } = null!; - public string Password { get; set; } = null!; - public int NbPlayers { get; set; } - public int idCreator { get; set; } + private int id; + private string? name; + private string? password; + private int nbPlayers; + private int idCreator; + /// + /// getters and setters of attributes + /// + public int? Id + { + get => id == -1 ? null : id; + private set { id = value == null || value < -1 ? -1 : value.Value; } + } + public string Name + { + get => name == null ? "" : name; + private set { name = value == "" ? null : value; } + } + public string Password + { + get => password == null ? "" : password; + private set { password = value == "" ? null : value; } + } + public int NbPlayers + { + get => nbPlayers; + set { nbPlayers = value < 0 ? 0 : value; } + } + public int? IdCreator + { + get => idCreator == -1 ? null : id; + private set { idCreator = value == null || value < -1 ? -1 : value.Value; } + } + + /// + /// constructor of a lobby + /// + /// the name of the lobby + /// the id of the creator + /// the password require to access to the lobby + /// the number of players in the lobby + /// the id of the lobby + public Lobby(string name, int idCreator, string password = "", int nbPlayer = 0, int? id = null) + { + Name = name; + IdCreator = idCreator; + Password = password; + NbPlayers = nbPlayer; + Id = id; + } } } diff --git a/WebApi/Model/Player.cs b/WebApi/Model/Player.cs index 5d641ac..4c20a75 100644 --- a/WebApi/Model/Player.cs +++ b/WebApi/Model/Player.cs @@ -5,19 +5,51 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace model +namespace Model { public class Player { /// - /// define a DTO for a player - /// properties : - /// Id : identifier in the database - /// Nickname : nickname for a player - /// HashedPassword : hashed of the password of the player + /// define a player + /// attributes : + /// id : identifier in the database + /// nickname : nickname for the player + /// hashedPassword : hashed of the password of the player /// - public int Id { get; set; } - public string Nickname { get; set; } = null!; - public string HashedPassword { get; set; } = null!; + private int id; + private string? nickname; + private string? hashedPassword; + + /// + /// getters and setters for attributes + /// + public int? Id + { + get => id == -1 ? null : id; + private set { id = value == null || value < -1 ? -1 : value.Value; } + } + public string Nickname + { + get => nickname == null ? "" : nickname; + private set { nickname = value == "" ? null : nickname; } + } + public string HashedPassword + { + get => hashedPassword == null ? "" : hashedPassword; + set { hashedPassword = value == "" ? null : value; } + } + + /// + /// constructor of a player + /// + /// nickname of the player + /// hash of the password of the player + /// id of the player + public Player(string nickname, string hashedPassword = "", int? id = null) + { + Nickname = nickname; + HashedPassword = hashedPassword; + Id = id; + } } } diff --git a/WebApi/Model/Question.cs b/WebApi/Model/Question.cs index 275659a..d376dd7 100644 --- a/WebApi/Model/Question.cs +++ b/WebApi/Model/Question.cs @@ -6,25 +6,66 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace model +namespace Model { public class Question { /// /// represent a mathematical question - /// properties : - /// Id : identifier of the question in the database - /// Content : the content of the question - /// Difficulty : difficulty (between 1 and 3 included) of the question - /// NbFails : number of time that people fail on this question - /// IdChapter : identifier of the chapter of the question - /// IdAnswerGood : identifier of the right answer to this question + /// attributes : + /// id : identifier of the question in the database + /// content : the content of the question + /// difficulty : difficulty (between 1 and 3 included) of the question + /// nbFails : number of time that people fail on this question + /// idChapter : identifier of the chapter of the question + /// idAnswerGood : identifier of the right answer to this question /// - public int Id { get; set; } - public string Content { get; set; } = null!; - public int Difficuty { get; set; } - public int NbFalls { get; set; } - public int IdChapter { get; set; } - public int IdAnswerGood { get; set; } + private int id; + private string? content; + private int difficulty; + private int nbFalls; + private int idChapter; + private int idAnswerGood; + + public int? Id + { + get => id == -1 ? null : id; + private set { id = value == null || value < -1 ? -1 : value.Value; } + } + public string Content + { + get => content == null ? "" : content; + set { content = value == "" ? null : value;} + } + public int Difficulty + { + get => difficulty; + set { difficulty = value < 0 ? 0 : value; } + } + public int NbFalls + { + get => nbFalls; + set { nbFalls = value < 0 ? 0 : value; } + } + public int? IdChapter + { + get => idChapter == -1 ? null : idChapter; + private set { idChapter = value == null || value < -1 ? -1 : value.Value; } + } + public int? IdAnswerGood + { + get => idAnswerGood == -1 ? null : idAnswerGood; + set { idAnswerGood = value == null || value < -1 ? -1 : value.Value; } + } + + public Question(string content, int idChapter = -1, int id = -1, int idAnswerGood = -1) + { + Id = id; + Content = content; + Difficulty = 1; + NbFalls = 0; + IdChapter = idChapter; + IdAnswerGood = idAnswerGood; + } } } diff --git a/WebApi/OrderCriterias/AdministratorOrderCriteria.cs b/WebApi/OrderCriterias/AdministratorOrderCriteria.cs new file mode 100644 index 0000000..9e284bd --- /dev/null +++ b/WebApi/OrderCriterias/AdministratorOrderCriteria.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrderCriterias +{ + public enum AdministratorOrderCriteria + { + ById = 0, + ByUserName = 1, + } +} diff --git a/WebApi/OrderCriterias/AnswerOrderCriteria.cs b/WebApi/OrderCriterias/AnswerOrderCriteria.cs index de76240..42a4e23 100644 --- a/WebApi/OrderCriterias/AnswerOrderCriteria.cs +++ b/WebApi/OrderCriterias/AnswerOrderCriteria.cs @@ -12,6 +12,7 @@ namespace OrderCriterias public enum AnswerOrderCriteria { ById = 0, - ByContent = 1 + ByContent = 1, + ByIdQuestion = 2, } } diff --git a/WebApi/OrderCriterias/ChapterOrderCriteria.cs b/WebApi/OrderCriterias/ChapterOrderCriteria.cs new file mode 100644 index 0000000..9bf5374 --- /dev/null +++ b/WebApi/OrderCriterias/ChapterOrderCriteria.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrderCriterias +{ + public enum ChapterOrderCriteria + { + ById = 0, + ByName = 1, + } +} diff --git a/WebApi/OrderCriterias/LobbyOrderCriteria.cs b/WebApi/OrderCriterias/LobbyOrderCriteria.cs new file mode 100644 index 0000000..1c6743b --- /dev/null +++ b/WebApi/OrderCriterias/LobbyOrderCriteria.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrderCriterias +{ + public enum LobbyOrderCriteria + { + ById = 0, + ByName = 1, + ByNbJoueur = 2, + } +} diff --git a/WebApi/OrderCriterias/PlayerOrderCriteria.cs b/WebApi/OrderCriterias/PlayerOrderCriteria.cs new file mode 100644 index 0000000..93401d1 --- /dev/null +++ b/WebApi/OrderCriterias/PlayerOrderCriteria.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrderCriterias +{ + public enum PlayerOrderCriteria + { + ById = 0, + ByNickname = 1, + } +} diff --git a/WebApi/OrderCriterias/QuestionOrderCriteria.cs b/WebApi/OrderCriterias/QuestionOrderCriteria.cs new file mode 100644 index 0000000..378b4d0 --- /dev/null +++ b/WebApi/OrderCriterias/QuestionOrderCriteria.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OrderCriterias +{ + public enum QuestionOrderCriteria + { + ById = 0, + ByContent = 1, + ByDifficulty = 2, + ByNbFalls = 3, + ByIdChapter = 4, + } +} diff --git a/WebApi/UnitTestsEntityManagers/UnitTestsEntityManagers.csproj b/WebApi/UnitTestsEntityManagers/UnitTestsEntityManagers.csproj index 089d180..ef25513 100644 --- a/WebApi/UnitTestsEntityManagers/UnitTestsEntityManagers.csproj +++ b/WebApi/UnitTestsEntityManagers/UnitTestsEntityManagers.csproj @@ -7,6 +7,7 @@ false true + $(MSBuildProjectDirectory)