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.

115 lines
4.5 KiB

using LibEntityFramework;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TrucAuMilieu
{
public partial class DataBdd
{
public ChampionContext contextCh = new ChampionContext();
public class ChampionsManager : IChampionsManager
{
private readonly DataBdd parent;
public ChampionsManager(DataBdd parent)
=> this.parent = parent;
public async Task<Champion?> AddItem (Champion? item)
{// ya comme une erreur le truc n'est pas save dans la bdd :(
await parent.contextCh.AddAsync(item.ChampToEf);
await parent.contextCh.SaveChangesAsync();
return item; //ou elle est lerreur je vais menerve elle est ou lerreur >:(
}
public Task<bool> DeleteItem(Champion? item)
{
throw new NotImplementedException();
}
public async Task<IEnumerable<Champion?>> GetItems(int index, int count, string? orderingPropertyName = null, bool descending = false)/*
=> parent.contextCh..GetItemsWithFilterAndOrdering(
c => true,
index, count,
orderingPropertyName, descending);*/
{// hihihi les arguments servent à rien pour l'instant y'a zero arguments utilises oupsi :3
List<ChampionEntity> lch = parent.contextCh.Champs.Take(count).Skip(index).ToList();
List<Champion> items = new List<Champion>();
foreach (var c in lch) { items.Add(c.EfToChamp()); }
return items;
}
public Task<IEnumerable<Champion?>> GetItemsByCharacteristic(string charName, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
throw new NotImplementedException();
}
public Task<IEnumerable<Champion?>> GetItemsByClass(ChampionClass championClass, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
throw new NotImplementedException();
}
public Task<IEnumerable<Champion?>> GetItemsByName(string substring, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
throw new NotImplementedException();
}
public Task<IEnumerable<Champion?>> GetItemsByRunePage(RunePage? runePage, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
throw new NotImplementedException();
}
public Task<IEnumerable<Champion?>> GetItemsBySkill(Skill? skill, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
throw new NotImplementedException();
}
public Task<IEnumerable<Champion?>> GetItemsBySkill(string skill, int index, int count, string? orderingPropertyName = null, bool descending = false)
{
throw new NotImplementedException();
}
public Task<int> GetNbItems()
{
throw new NotImplementedException();
}
public Task<int> GetNbItemsByCharacteristic(string charName)
{
throw new NotImplementedException();
}
public Task<int> GetNbItemsByClass(ChampionClass championClass)
{
throw new NotImplementedException();
}
public Task<int> GetNbItemsByName(string substring)
{
throw new NotImplementedException();
}
public Task<int> GetNbItemsByRunePage(RunePage? runePage)
{
throw new NotImplementedException();
}
public Task<int> GetNbItemsBySkill(Skill? skill)
{
throw new NotImplementedException();
}
public Task<int> GetNbItemsBySkill(string skill)
{
throw new NotImplementedException();
}
public Task<Champion?> UpdateItem(Champion? oldItem, Champion? newItem)
{
throw new NotImplementedException();
}
}
}
}