# Projet d'Entity FrameWork et Consomation et Développement de services Notre projet à pour objectif la liaison entre une base de donnée et un client, par l'utilisation d' ``EntityFramework`` et d'une ``API`` C# créé par nous même. ![C#](https://img.shields.io/badge/c%23-%23239120.svg?style=for-the-badge&logo=c-sharp&logoColor=white) ![JWT](https://img.shields.io/badge/JWT-black?style=for-the-badge&logo=JSON%20web%20tokens) ![Markdown](https://img.shields.io/badge/markdown-%23000000.svg?style=for-the-badge&logo=markdown&logoColor=white) > *A noter que seul la v1 est prise en compte, la v2 et v2.2 ne sont presentes uniquement pour prouver notre capacité à versionner* Ce projet est decoupé en deux parties : ## :alien: Consomation et Développement de services :construction_worker: #### :steam_locomotive: Comment lancer le projet ? > (Explication...) :construction: #### :checkered_flag: Etat des livrables : :construction: > * :heavy_check_mark: Mise en place de toutes les opérations CRUD > * :heavy_check_mark: API RESTful (respect des règles de routage, utilisation des bons status code ...) > * :heavy_exclamation_mark: Utilisation des fichiers configurations > * :heavy_check_mark: Versionnage de l'api (avec versionnage de la doc) > * :heavy_check_mark: Logs > * :heavy_check_mark: Tests unitaires > * :heavy_exclamation_mark: Réalisation du client MAUI et liaison avec l'api > * :heavy_check_mark:Liaison avec la base de données > * :heavy_check_mark:Filtrage + Pagination des données > * :construction: Propreté du code (Vous pouvez vous servir de sonarqube) > * :heavy_check_mark: Dockerisation et Hébergement des API (CodeFirst) > * :heavy_exclamation_mark: Sécurité > * :heavy_check_mark: Utilisation SonarQube [![Build Status](https://codefirst.iut.uca.fr/api/badges/corentin.richard/EntityFramework_ConsoDeServices_TP/status.svg)](https://codefirst.iut.uca.fr/corentin.richard/EntityFramework_ConsoDeServices_TP) #### Diagramme d'architechture : => Disponible à `./Diagramme d'architecture.jpg` --- ## :package: Entity FrameWork :construction_worker: :construction: Partie 1 : * Exo1 : une base de données une table de champion utilisation du client console/mobile requetes CRUD (+ tri, filtrage) * Exo2 : UT Base de données stubbée SQLiteInMemory * Exo3 : Déploiement EF et tests via code#0 --- Partie 2 : * Exo4 : implémentation des runes et skins (1 table -> pas de relation) * Exo5 : Relation entre champion et skin (OneToMany) * Exo6 : Relation entre Champion RunePage et Rune (ManyToMany) * Exo7 : mapping entre model et entité (intégration de qualité) (en 1 table et avec relations) * Exo8 : Ajouter le paterne UnitOfWork (rollback en cas de probleme sur les transaction) --- # Sujet principal : --- # prepaLoL ## Diagramme de classes du modèle ```mermaid classDiagram class LargeImage{ +/Base64 : string } class Champion{ +/Name : string +/Bio : string +/Icon : string +/Characteristics : Dictionary~string, int~ ~ AddSkin(skin : Skin) bool ~ RemoveSkin(skin: Skin) bool + AddSkill(skill: Skill) bool + RemoveSkill(skill: Skill) bool + AddCharacteristics(someCharacteristics : params Tuple~string, int~[]) + RemoveCharacteristics(label : string) bool + this~label : string~ : int? } Champion --> "1" LargeImage : Image class ChampionClass{ <> Unknown, Assassin, Fighter, Mage, Marksman, Support, Tank, } Champion --> "1" ChampionClass : Class class Skin{ +/Name : string +/Description : string +/Icon : string +/Price : float } Skin --> "1" LargeImage : Image Champion "1" -- "*" Skin class Skill{ +/Name : string +/Description : string } class SkillType{ <> Unknown, Basic, Passive, Ultimate, } Skill --> "1" SkillType : Type Champion --> "*" Skill class Rune{ +/Name : string +/Description : string } Rune --> "1" LargeImage : Image class RuneFamily{ <> Unknown, Precision, Domination } Rune --> "1" RuneFamily : Family class Category{ <> Major, Minor1, Minor2, Minor3, OtherMinor1, OtherMinor2 } class RunePage{ +/Name : string +/this[category : Category] : Rune? - CheckRunes(newRuneCategory : Category) - CheckFamilies(cat1 : Category, cat2 : Category) bool? - UpdateMajorFamily(minor : Category, expectedValue : bool) } RunePage --> "*" Rune : Dictionary~Category,Rune~ ``` ## Diagramme de classes des interfaces de gestion de l'accès aux données ```mermaid classDiagram direction LR; class IGenericDataManager~T~{ <> GetNbItems() Task~int~ GetItems(index : int, count : int, orderingPropertyName : string?, descending : bool) Task~IEnumerable~T~~ GetNbItemsByName(substring : string) GetItemsByName(substring : string, index : int, count : int, orderingPropertyName : string?, descending : bool) Task~IEnumerable~T~~ UpdateItem(oldItem : T, newItem : T) Task~T~~ AddItem(item : T) Task~T~ DeleteItem(item : T) Task~bool~ } class IChampionsManager{ <> GetNbItemsByCharacteristic(charName : string) GetItemsByCharacteristic(charName : string, index : int, count : int, orderingPropertyName : string?, descending : bool) Task~IEnumerable~Champion?~~ GetNbItemsByClass(championClass : ChampionClass) GetItemsByClass(championClass : ChampionClass, index : int, count : int, orderingPropertyName : string?, descending : bool) Task~IEnumerable~Champion?~~ GetNbItemsBySkill(skill : Skill?) GetItemsBySkill(skill : Skill?, index : int, count : int, orderingPropertyName : string?, descending : bool) Task~IEnumerable~Champion?~~ GetNbItemsBySkill(skill : string) GetItemsBySkill(skill : string, index : int, count : int, orderingPropertyName : string?, descending : bool) Task~IEnumerable~Champion?~~ GetNbItemsByRunePage(runePage : RunePage?) GetItemsByRunePage(runePage : RunePage?, index : int, count : int, orderingPropertyName : string?, descending : bool) Task~IEnumerable~Champion?~~ } class ISkinsManager{ <> GetNbItemsByChampion(champion : Champion?) GetItemsByChampion(champion : Champion?, index : int, count : int, orderingPropertyName : string?, descending : bool) Task~IEnumerable~Skin?~~ } class IRunesManager{ <> GetNbItemsByFamily(family : RuneFamily) GetItemsByFamily(family : RuneFamily, index : int, count : int, orderingPropertyName : string?, descending : bool) Task~IEnumerable~Rune?~~ } class IRunePagesManager{ <> GetNbItemsByRune(rune : Rune?) GetItemsByRune(rune : Rune?, index : int, count : int, orderingPropertyName : string?, descending : bool) Task~IEnumerable~RunePage?~~ GetNbItemsByChampion(champion : Champion?) GetItemsByChampion(champion : Champion?, index : int, count : int, orderingPropertyName : string?, descending : bool) Task~IEnumerable~RunePage?~~ } IGenericDataManager~Champion?~ <|.. IChampionsManager : T--Champion? IGenericDataManager~Skin?~ <|.. ISkinsManager : T--Skin? IGenericDataManager~Rune?~ <|.. IRunesManager : T--Rune? IGenericDataManager~RunePage?~ <|.. IRunePagesManager : T--RunePage? class IDataManager{ <> } IChampionsManager <-- IDataManager : ChampionsMgr ISkinsManager <-- IDataManager : SkinsMgr IRunesManager <-- IDataManager : RunesMgr IRunePagesManager <-- IDataManager : RunePagesMgr ``` ## Diagramme de classes simplifié du Stub ```mermaid classDiagram direction TB; IDataManager <|.. StubData ChampionsManager ..|> IChampionsManager StubData --> ChampionsManager RunesManager ..|> IRunesManager StubData --> RunesManager RunePagesManager ..|> IRunePagesManager StubData --> RunePagesManager SkinsManager ..|> ISkinsManager StubData --> SkinsManager StubData --> RunesManager StubData --> "*" Champion StubData --> "*" Rune StubData --> "*" RunePages StubData --> "*" Skins ```