Exemplo n.º 1
0
        public RockstarStatus Get(GetStatus request)
        {
            var rockstar = RockstarRepository.GetByLastName(request.LastName);
            if (rockstar == null)
                throw HttpError.NotFound("'{0}' is not a Rockstar".Fmt(request.LastName));

            var status = new RockstarStatus
            {
                Alive = RockstarRepository.IsAlive(request.LastName)
            }.PopulateWith(rockstar); //Populates with matching fields

            return status;
        }
Exemplo n.º 2
0
        public RockstarStatus Get(GetStatus request)
        {
            var rockstar = RockstarRepository.GetByLastName(request.LastName);

            if (rockstar == null)
            {
                throw HttpError.NotFound("'{0}' is not a Rockstar".Fmt(request.LastName));
            }

            var status = new RockstarStatus
            {
                Alive = RockstarRepository.IsAlive(request.LastName)
            }.PopulateWith(rockstar); //Populates with matching fields

            return(status);
        }