Esempio n. 1
0
        public Area CreateArea(Area area)
        {
            using (var db = new CardsDb())
            {
                var result = db.Areas.Add(area);
                db.SaveChanges();

                return result;
            }
        }
Esempio n. 2
0
 public Area Put(int id, Area area)
 {
     return Area.Update(id, area.Name);
 }
Esempio n. 3
0
 public Area Post(Area area)
 {
     return Area.Create(area.Name);
 }
Esempio n. 4
0
        public static Area Create(string name)
        {
            var db = DbFactory.Create();
            var area = new Area()
            {
                Name = name,
            };

            return db.CreateArea(area);
        }
Esempio n. 5
0
        public Area UpdateArea(Area area)
        {
            using (var db = new CardsDb())
            {
                db.Entry(area).State = EntityState.Modified;
                db.SaveChanges();

                return area;
            }
        }