public async Task <IHttpActionResult> PutSkill(int id, Skill skill) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != skill.SkillId) { return(BadRequest()); } db.Entry(skill).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SkillExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> PutMapCharacterTypeStatsLevel(int id, MapCharacterTypeStatsLevel mapCharacterTypeStatsLevel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mapCharacterTypeStatsLevel.MapCharacterTypeStatsLevelId) { return(BadRequest()); } db.Entry(mapCharacterTypeStatsLevel).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MapCharacterTypeStatsLevelExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> PutPurchaseType(int id, PurchaseType purchaseType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != purchaseType.PurchaseTypeId) { return(BadRequest()); } db.Entry(purchaseType).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PurchaseTypeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }