private void checkQueue()
        {
            MessageQueue messageQueue = null;

            using (messageQueue = new MessageQueue(@".\Private$\EulerAnswers"))
            {
                System.Messaging.Message[] messages = messageQueue.GetAllMessages();

                foreach (System.Messaging.Message message in messages)
                {
                    messageQueue.Formatter = new XmlMessageFormatter(new Type[] { typeof(EulerAnswerRAW) });
                    EulerAnswerRAW fa             = (EulerAnswerRAW)messageQueue.Receive().Body;
                    EulerAnswer    to_be_inserted = new EulerAnswer
                    {
                        elapsedMS = fa.elapsedMS,
                        task_id   = fa.task_id,
                        number    = fa.number,
                        result    = fa.result
                    };
                    if (ModelState.IsValid)
                    {
                        // Thread.sus
                        db.Answers.Add(to_be_inserted);
                        db.SaveChanges();
                    }
                }
            }
        }
        public ActionResult DeleteConfirmed(int id)
        {
            EulerAnswer eulerAnswer = db.Answers.Find(id);

            db.Answers.Remove(eulerAnswer);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id,number,task_id,result,elapsedMS")] EulerAnswer eulerAnswer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(eulerAnswer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(eulerAnswer));
 }
        public ActionResult Create([Bind(Include = "id,number,task_id,result,elapsedMS")] EulerAnswer eulerAnswer)
        {
            if (ModelState.IsValid)
            {
                db.Answers.Add(eulerAnswer);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(eulerAnswer));
        }
        // GET: EulerAnswers/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EulerAnswer eulerAnswer = db.Answers.Find(id);

            if (eulerAnswer == null)
            {
                return(HttpNotFound());
            }
            return(View(eulerAnswer));
        }