Example #1
0
 public void removeAll()
 {
     using (var ctx = new SaprSimDbContext())
     {
         ctx.statistics.RemoveRange(ctx.statistics);
     }
 }
Example #2
0
 public void removeAll()
 {
     using (var ctx = new SaprSimDbContext())
     {
         ctx.models.RemoveRange(ctx.models);
     }
 }
Example #3
0
 public AbstractStatiscticsBean findById(int id)
 {
     using (var ctx = new SaprSimDbContext())
     {
         return(ctx.statistics.Where(s => s.id == id).FirstOrDefault());
     }
 }
Example #4
0
 public void removeById(int id)
 {
     using (var ctx = new SaprSimDbContext())
     {
         AbstractStatiscticsBean stat = ctx.statistics.Where(s => s.id == id).FirstOrDefault();
         ctx.statistics.Remove(stat);
     }
 }
Example #5
0
 public void save(AbstractStatiscticsBean value)
 {
     using (var ctx = new SaprSimDbContext())
     {
         ctx.statistics.Add(value);
         ctx.SaveChanges();
     }
 }
Example #6
0
 public void removeById(int id)
 {
     using (var ctx = new SaprSimDbContext())
     {
         Model model = ctx.models.Where(s => s.id == id).FirstOrDefault();
         ctx.models.Remove(model);
     }
 }
Example #7
0
 public void save(Model model)
 {
     using (var ctx = new SaprSimDbContext())
     {
         ctx.models.Add(model);
         ctx.SaveChanges();
     }
 }
Example #8
0
 public Model findById(int id)
 {
     using (var ctx = new SaprSimDbContext())
     {
         return(ctx.models
                .Include(s => s.entities).Include(s => s.entities.Select(i => i.input)).Include(s => s.entities.Select(i => i.output))
                .Include(s => s.projects)
                .Include(s => s.resources).Where(s => s.id == id).FirstOrDefault());
     }
 }
Example #9
0
        public ICollection <AbstractStatiscticsBean> findAll()
        {
            IList <AbstractStatiscticsBean> stat;

            using (var ctx = new SaprSimDbContext())
            {
                stat = ctx.statistics.ToList();
            }

            return(stat);
        }
Example #10
0
        public ICollection <Model> findAll()
        {
            IList <Model> mdls;

            using (var ctx = new SaprSimDbContext())
            {
                mdls = ctx.models.ToList();
            }

            return(mdls);
        }
Example #11
0
        public void saveAll(ICollection <AbstractStatiscticsBean> values)
        {
            using (var ctx = new SaprSimDbContext())
            {
                foreach (AbstractStatiscticsBean stat in values)
                {
                    ctx.statistics.Add(stat);
                }

                ctx.SaveChanges();
            }
        }
Example #12
0
        public void saveAll(ICollection <Model> models)
        {
            using (var ctx = new SaprSimDbContext())
            {
                foreach (Model m in models)
                {
                    ctx.models.Add(m);
                }

                ctx.SaveChanges();
            }
        }