public async Task <IHttpActionResult> Puttbl_Country_List(int id, tbl_Country_List tbl_Country_List) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tbl_Country_List.fld_Number) { return(BadRequest()); } db.Entry(tbl_Country_List).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!tbl_Country_ListExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> Gettbl_Country_List(int id) { tbl_Country_List tbl_Country_List = await db.tbl_Country_List.FindAsync(id); if (tbl_Country_List == null) { return(NotFound()); } return(Ok(tbl_Country_List)); }
public async Task <IHttpActionResult> Posttbl_Country_List(tbl_Country_List tbl_Country_List) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.tbl_Country_List.Add(tbl_Country_List); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = tbl_Country_List.fld_Number }, tbl_Country_List)); }
public async Task <IHttpActionResult> Deletetbl_Country_List(int id) { tbl_Country_List tbl_Country_List = await db.tbl_Country_List.FindAsync(id); if (tbl_Country_List == null) { return(NotFound()); } db.tbl_Country_List.Remove(tbl_Country_List); await db.SaveChangesAsync(); return(Ok(tbl_Country_List)); }