public IHttpActionResult Create(BunnyModel bunny) { if (!this.ModelState.IsValid) { return(BadRequest(ModelState)); } else { var newBunny = new Bunny { Name = bunny.Name, Health = bunny.Health, Color = bunny.Color, }; this.data.Bunnies.Add(newBunny); this.data.Bunnies.SaveChanges(); bunny.Id = newBunny.Id; return(Ok(newBunny)); } }
public void ProcessMessage(BunnyModel msg) { //do something with the message }