/// <summary> /// Responsible for creating a fire incident /// </summary> /// <param name="fireIncident">The fire incident</param> /// <returns>Html Status</returns> public IHttpActionResult Post(FireIncident fireIncident) { Repository.Add(fireIncident); if (Notifier != null) Notifier.Raise(fireIncident); return Ok(); }
/// <summary> /// Add a fire incident to repository /// </summary> /// <param name="incident">the incident to add</param> /// <returns></returns> public FireIncident Add(FireIncident incident) { List<FireIncident> fireIncidents = (FireIncidents as List<FireIncident>); //this is for demo purposes. 100 elements do the trick if (fireIncidents.Count() > 100) fireIncidents.RemoveRange(0, 1); fireIncidents.Add(incident); return incident; }