public ArDict Edit(ArDict toEdit)
 {
     using (_session = DbManager.GetSession())
     {
         _session.Update(toEdit);
         _session.Flush();
         return(toEdit);
     }
 }
 public bool Delete(ArDict toDelete)
 {
     using (_session = DbManager.GetSession())
     {
         _session.Delete(toDelete);
         _session.Flush();
         return(true);
     }
 }
 public ArDict Create(ArDict toAdd)
 {
     using (_session = DbManager.GetSession())
     {
         _session.Save(toAdd);
         _session.Flush();
         return(toAdd);
     }
 }
Esempio n. 4
0
        private static void CreateEmptyEntry(long userId, string token, string replacement = "")
        {
            var toAdd = new ArDict
            {
                Token       = token,
                Replacement = replacement,
                Occurance   = 1,
                Hit         = 1,
                Trash       = ""
            };
            var repository = new ArDictRepository();

            repository.Create(toAdd);

            BlLog.Log(userId, "Entity", "Create arabic dictionnary", "ArabicDictCreated", new object[] { toAdd.Token, toAdd.Replacement });
        }