Exemple #1
0
 public Simcha GetSimchaById(int simchaId)
 {
     using (var context = new SimchaDataContext(_connectionString))
     {
         return(context.Simchas.FirstOrDefault(s => s.Id == simchaId));
     }
 }
Exemple #2
0
 public void AddSimcha(Simcha simcha)
 {
     using (var context = new SimchaDataContext(_connectionString))
     {
         context.Simchas.InsertOnSubmit(simcha);
         context.SubmitChanges();
     }
 }
Exemple #3
0
        public IEnumerable <Simcha> GetAllSimchos()
        {
            List <Simcha> simchos = new List <Simcha>();

            using (var context = new SimchaDataContext(_connectionString))
            {
                simchos = context.Simchas.ToList();
            }
            foreach (Simcha s in simchos)
            {
                SetSimchaTotals(s);
            }
            return(simchos);
        }