public IHttpActionResult Post(Heroi heroi) { if (heroi == null) { return(BadRequest()); } else { heroi.Id = idIncremento++; listaHerois.Add(heroi); return(Ok(heroi)); } }
public IHttpActionResult Post(Heroi heroi) { if (heroi == null) { return(BadRequest()); } lock (objetoLock) { heroi.Id = ++IdGenerator; Herois.Add(heroi); } return(Ok()); }
public IHttpActionResult Post(Heroi heroi) { if (heroi == null) { return(BadRequest()); } else { lock (lockObject) { heroi.Id = Herois.Count + 1; } } Herois.Add(heroi); return(Ok(heroi)); }
public IHttpActionResult Post(Heroi heroi) { if (heroi == null) { return(BadRequest()); } else { lock (objetoLock) { Herois.Add(heroi); heroi.Id = ++UltimoId; } return(Ok()); } }
public IHttpActionResult Post(Heroi heroi) { if (heroi == null) { return(BadRequest()); } else { lock (ObjetoLock) { heroi.Id = ++idInterno; herois.Add(heroi); } //salva no banco de dados return(Ok(heroi)); } }
public IHttpActionResult Post(Heroi heroi) { if (heroi == null) { return(BadRequest()); } else { lock (objetoLock) { heroi.Id = ++IdS; herois.Add(heroi); return(Ok(heroi)); } } }