Exemple #1
0
        public IHttpActionResult PutPlatformCategory(int id, PlatformCategory platformCategory)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != platformCategory.id)
            {
                return BadRequest();
            }

            db.Entry(platformCategory).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PlatformCategoryExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
Exemple #2
0
        public IHttpActionResult GetPlatformCategory(int id)
        {
            PlatformCategory platformCategory = db.PlatformCategories.Find(id);
            if (platformCategory == null)
            {
                return NotFound();
            }

            return Ok(platformCategory);
        }
Exemple #3
0
        public IHttpActionResult PostPlatformCategory(PlatformCategory platformCategory)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.PlatformCategories.Add(platformCategory);
            db.SaveChanges();

            return CreatedAtRoute("DefaultApi", new { id = platformCategory.id }, platformCategory);
        }
Exemple #4
0
        public IHttpActionResult DeletePlatformCategory(int id)
        {
            PlatformCategory platformCategory = db.PlatformCategories.Find(id);
            if (platformCategory == null)
            {
                return NotFound();
            }

            db.PlatformCategories.Remove(platformCategory);
            db.SaveChanges();

            return Ok(platformCategory);
        }
 public PlatformDependentValue(PlatformCategory t)
 {
     this.PCSetting                  = new PlatformSetting <T>();
     this.MacSetting                 = new PlatformSetting <T>();
     this.iOSSetting                 = new PlatformSetting <T>();
     this.AndroidSetting             = new PlatformSetting <T>();
     this.TabletSetting              = new PlatformSetting <T>();
     this.MiniTabletSetting          = new PlatformSetting <T>();
     this.PhoneSetting               = new PlatformSetting <T>();
     this.MouseSetting               = new PlatformSetting <T>();
     this.TouchSetting               = new PlatformSetting <T>();
     this.LowMemorySetting           = new PlatformSetting <T>();
     this.MediumMemorySetting        = new PlatformSetting <T>();
     this.HighMemorySetting          = new PlatformSetting <T>();
     this.NormalScreenDensitySetting = new PlatformSetting <T>();
     this.HighScreenDensitySetting   = new PlatformSetting <T>();
     this.type = t;
 }