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.

30 lines
766 B

using EFlib;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EFMapping
{
public static class EFSkillMapper
{
public static EFSkill toEF(this Skill skill, SQLiteContext context)
{
var EfSkill = context.Skills.Find(skill.Name);
if (EfSkill == null)
{
return new()
{
Name = skill.Name,
Description = skill.Description,
Type = skill.Type
};
}
return EfSkill;
}
public static Skill toModel(this EFSkill skill)=> new(skill.Name, skill.Type, skill.Description);
}
}