public bool Delete(AntiDict toDelete) { using (_session = DbManager.GetSession()) { _session.Delete(toDelete); _session.Flush(); return(true); } }
public AntiDict Create(AntiDict toAdd) { using (_session = DbManager.GetSession()) { _session.Save(toAdd); _session.Flush(); return(toAdd); } }
public AntiDict Edit(AntiDict toEdit) { using (_session = DbManager.GetSession()) { _session.Update(toEdit); _session.Flush(); return(toEdit); } }
private static void CreateEmptyEntry(long userId, string token, string replacement = "") { var toAdd = new AntiDict { Token = token, Replacement = replacement, Occurance = 0 }; var repository = new AntiDictRepository(); repository.Create(toAdd); BlLog.Log(userId, "Entity", "Create anti dictionnary", "AntiDictCreated", new object[] { toAdd.Token, toAdd.Replacement }); }