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

namespace EHEC_Server
{
    public partial class Result
    {
        public Result CreateResult(Result result)
        {
            try
            {
                using (EHEC_DBEntities ctx = new EHEC_DBEntities())
                {
                    ctx.Results.Add(result);
                    ctx.SaveChanges();
                }
                return result;
            }
            catch (Exception)
            {
                return new Result();
            }
        }
        public List<Result> GetAllResults()
        {
            using (EHEC_DBEntities ctx = new EHEC_DBEntities())
            {
                ctx.Configuration.ProxyCreationEnabled = false;
                List<Result> list = new List<Result>();
                return ctx.Results.ToList();
            }
        }
    }
}