using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using PowerMatterServiceReference; using Microsoft.AspNetCore.Cors; // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 namespace Winsoft.GOV.PowerMatter.Restful.Controllers { [Route("api/[controller]")] [EnableCors("any")] public class BranchController : Controller { IPowerMettersService _powerMatterService; public BranchController(IPowerMettersService powerMatterService) { _powerMatterService = powerMatterService; } // GET: api/values [HttpGet("all/{c:int}")] [Produces(typeof(List))] public async Task Get(County c) { List bs = await _powerMatterService.GetBranchsExAsync(c); if (bs == null) bs = new List(); return Ok(bs); } } }