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

namespace EHEC_Server
{
    public partial class Origin
    {
        public Origin CreateOrigin(Origin origin)
        {
            try
            {
                using (EHEC_DBEntities ctx = new EHEC_DBEntities())
                {
                    ctx.Origins.Add(origin);
                    ctx.SaveChanges();
                }
                return origin;
            }
            catch (Exception)
            {
                return new Origin();
            }
        }
        public List<Origin> GetAllOrigins()
        {
            using (EHEC_DBEntities ctx = new EHEC_DBEntities())
            {
                return ctx.Origins.ToList();
            }
        }

    }
}