using System.Collections.Generic; using System.Web.Http; namespace bsmd.AIS2Service { public class SLRController : ApiController { [HttpGet] public IEnumerable Get([FromUri] int? id) { if (!id.HasValue) return null; List result = AISManager.SQLiteStorage.GetShipLocationReports(id.Value); foreach(ShipLocationReport report in result) { if (AISManager.SitRep.ContainsKey(report.MMSI)) { report.Destination = AISManager.SitRep[report.MMSI].Destination; report.Name = AISManager.SitRep[report.MMSI].Name; report.NavStatus = AIS_PosReport.GetNavStatus(AISManager.SitRep[report.MMSI].NavStatus); report.IMO = AISManager.SitRep[report.MMSI].IMO; } } return result; } } }