Example #1
0
        public Label CreateLabel(Label label)
        {
            using (var db = new CardsDb())
            {
                label = db.Labels.Add(label);
                db.SaveChanges();

                return(label);
            }
        }
Example #2
0
        public Area UpdateArea(Area area)
        {
            using (var db = new CardsDb())
            {
                db.Entry(area).State = EntityState.Modified;
                db.SaveChanges();

                return(area);
            }
        }
Example #3
0
        public Activity CreateActivity(Activity activity)
        {
            using (var db = new CardsDb())
            {
                db.Activities.Add(activity);
                db.SaveChanges();

                return(activity);
            }
        }
Example #4
0
        public Card CreateCard(Card card)
        {
            using (var db = new CardsDb())
            {
                var result = db.Cards.Add(card);
                db.SaveChanges();

                return(result);
            }
        }
Example #5
0
        public Card UpdateCard(Card card)
        {
            using (var db = new CardsDb())
            {
                db.Entry(card).State = EntityState.Modified;
                db.SaveChanges();

                return(card);
            }
        }
Example #6
0
        public Area CreateArea(Area area)
        {
            using (var db = new CardsDb())
            {
                var result = db.Areas.Add(area);
                db.SaveChanges();

                return(result);
            }
        }
Example #7
0
        public Label CreateLabel(Label label)
        {
            using (var db = new CardsDb())
            {
                label = db.Labels.Add(label);
                db.SaveChanges();

                return label;
            }
        }
Example #8
0
        public Label DeleteLabel(Label label)
        {
            using (var db = new CardsDb())
            {
                db.Entry(new Label() { ID = label.ID }).State = EntityState.Deleted;
                db.SaveChanges();

                return label;
            }
        }
Example #9
0
        public Card CreateCard(Card card)
        {
            using (var db = new CardsDb())
            {
                var result = db.Cards.Add(card);
                db.SaveChanges();

                return result;
            }
        }
Example #10
0
        public Area CreateArea(Area area)
        {
            using (var db = new CardsDb())
            {
                var result = db.Areas.Add(area);
                db.SaveChanges();

                return result;
            }
        }
Example #11
0
        public Activity CreateActivity(Activity activity)
        {
            using (var db = new CardsDb())
            {
                db.Activities.Add(activity);
                db.SaveChanges();

                return activity;
            }
        }
Example #12
0
        public Label DeleteLabel(Label label)
        {
            using (var db = new CardsDb())
            {
                db.Entry(new Label()
                {
                    ID = label.ID
                }).State = EntityState.Deleted;
                db.SaveChanges();

                return(label);
            }
        }
Example #13
0
        public Card UpdateCard(Card card)
        {
            using (var db = new CardsDb())
            {
                db.Entry(card).State = EntityState.Modified;
                db.SaveChanges();

                return card;
            }
        }
Example #14
0
        public Area UpdateArea(Area area)
        {
            using (var db = new CardsDb())
            {
                db.Entry(area).State = EntityState.Modified;
                db.SaveChanges();

                return area;
            }
        }