TypeVikingFactory.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using CD67.ModeleMVC.Entity;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data.Entity;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace CD67.ModeleMVC.Factory
  9. {
  10. public partial class TypeVikingFactory
  11. {
  12. ///// <summary>
  13. ///// Constructeur public lié au constructeur de base
  14. ///// </summary>
  15. ///// <param name="dbContext">Context Entity Framework utilisé dans la classe</param>
  16. //public TypeVikingFactory(ModeleMVCEntities dbContext) : base(dbContext) { }
  17. /// <summary>
  18. /// Retourne une liste d'objets selon des paramètres
  19. /// </summary>
  20. /// <returns>Liste d'objets</returns>
  21. public Dictionary<int, string> getManyBy(int TypeId)
  22. {
  23. //cas de sortie directe
  24. if (TypeId == -1) return new Dictionary<int, string>();
  25. //liste fictive utilisant le type passé en entrée
  26. return new Dictionary<int, string>()
  27. {
  28. { 1, $"Type-{TypeId} Toto" },
  29. { 2, $"Type-{TypeId} Tata" },
  30. { 3, $"Type-{TypeId} Tutu" }
  31. };
  32. }
  33. }
  34. }