public void Update(TileCollisionBox box)
        {
            TileCollisionBox dbBox = Context.TileCollisionBoxes.SingleOrDefault(x => x.CollisionBoxID == box.CollisionBoxID);
            if (dbBox == null) return;

            Context.Entry(dbBox).CurrentValues.SetValues(box);
        }
 public void Upsert(TileCollisionBox box)
 {
     if (box.CollisionBoxID <= 0)
     {
         Context.TileCollisionBoxes.Add(box);
     }
     else
     {
         Update(box);
     }
 }
 public void Delete(TileCollisionBox box)
 {
     Context.TileCollisionBoxes.Remove(box);
 }
 public bool Exists(TileCollisionBox box)
 {
     TileCollisionBox dbBox = Context.TileCollisionBoxes.SingleOrDefault(x => x.CollisionBoxID == box.CollisionBoxID);
     return !Object.ReferenceEquals(dbBox, null);
 }
 public TileCollisionBox Add(TileCollisionBox box)
 {
     return Context.TileCollisionBoxes.Add(box);
 }