public bool Update(XMark mark)
 {
     var existingEntry = _objectFactory.GetRepositoryInstance<XMark>().GetById(mark.Id);
     if (existingEntry == null)
         return false;
     _objectFactory.GetRepositoryInstance<XMark>().Detach(existingEntry);
     _objectFactory.GetRepositoryInstance<XMark>().Update(mark);
     try
     {
         _objectFactory.Commit();
         return true;
     }
     catch
     {
         return false;
     }
 }
 public Guid? Create(XMark subject)
 {
     _objectFactory.GetRepositoryInstance<XMark>().Add(subject);
     _objectFactory.Commit();
     return _objectFactory.GetRepositoryInstance<XMark>().Find(x => x.Id == subject.Id).FirstOrDefault().Id;
 }