using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ServiceModel;


namespace EHEC_Server
{
    public partial class Exam
    {
        public Exam CreateExam(Exam exam)
        {
            try
            {
                using (EHEC_DBEntities ctx = new EHEC_DBEntities())
                {
                    ctx.Exams.Add(exam);
                    ctx.SaveChanges();
                }
                return exam;
            }
            catch (Exception)
            {
                return new Exam();
            }
        }
        public List<Exam> GetAllExams()
        {
            using (EHEC_DBEntities ctx = new EHEC_DBEntities())
            {
                return ctx.Exams.ToList();
            }
        }
    }
}