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.

33 lines
922 B

using EFlib;
using Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EFMapping
{
public static class EFCharacteristicsMapper
{
public static EFCharacteristics toEF(this KeyValuePair<string, int> item, EFChampion champion, SQLiteContext context)
{
var EfCharacteristics = context.Characteristics.Find(item.Key, champion.Name);
if (EfCharacteristics == null)
{
return new()
{
Name = item.Key,
Value = item.Value,
NameChampion = champion.Name
};
}
return EfCharacteristics;
}
public static Tuple<string, int> toModel(this EFCharacteristics Charac)=> new(Charac.Name, Charac.Value);
}
}