public long CreateSkillTab(long characterId, SkillTab skillTab) { Maple2.Sql.Model.SkillTab model = storage.skillTabConverter.ToModel(skillTab); model.Id = 0; model.CharacterId = characterId; context.SkillTab.Add(model); return(context.TrySaveChanges() ? model.Id : -1); }
public void StageSkillTabs(long characterId, ICollection <SkillTab> skillTabs) { foreach (SkillTab skillTab in skillTabs) { Maple2.Sql.Model.SkillTab dbSkillTab = context.SkillTab.Find(skillTab.Id); Debug.Assert(dbSkillTab?.CharacterId == characterId); storage.skillTabConverter.ToModel(skillTab, dbSkillTab); } }