using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.SignalR; using WebAPI.Hubs; // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 namespace WebAPI.Controllers { [Route("[controller]")] [ApiController] public class WhoIsSpyController : ControllerBase { private readonly IHubContext hubContext; public WhoIsSpyController(IHubContext hubContext) { this.hubContext = hubContext; } // GET: api/ [HttpGet] public IEnumerable Get() { return new string[] { "value1", "value2" }; } // GET api//5 [HttpGet("{id}")] public string Get(string id) { return "value"; } // POST api/ [HttpPost] public void Post([FromBody] string value) { hubContext.Clients.All.SendAsync(""); } // PUT api//5 [HttpPut("{id}")] public void Put(string id, [FromBody] string value) { } // DELETE api//5 [HttpDelete("{id}")] public void Delete(string id) { } } }