public IHttpActionResult Get([FromUri] int id)
        {
            Bus bus = service.Get(id);

            if (bus == null)
            {
                return(StatusCode(HttpStatusCode.NoContent));
            }

            return(Ok(bus));
        }
Exemplo n.º 2
0
        public GetBusActor(BusService busService)
        {
            _busService = busService;

            Receive <string>(message =>
            {
                if (string.Equals(message, findAllCommand, System.StringComparison.OrdinalIgnoreCase))
                {
                    Sender.Tell(_busService.Get());
                }
                else
                {
                    Sender.Tell(_busService.Get(message));
                }
            });
        }