public int PostCountrys([FromBody] Directory_Countrys value) { try { this.ef_dir.Add(value); return(ef_dir.Save()); } catch (Exception e) { return(-1); } }
public int PutCountrys(int id, [FromBody] Directory_Countrys value) { try { this.ef_dir.Update(value); return(this.ef_dir.Save()); } catch (Exception e) { return(-1); } }
public IHttpActionResult GetCountrysOfCodeSNG(int code) { try { Directory_Countrys ens = this.ef_dir .Context .Where(w => w.code_sng == code) .ToList() .Select(m => m.GetDirectory_Countrys()).FirstOrDefault(); return(Ok(ens)); } catch (Exception e) { return(BadRequest(e.Message)); } }