public List <CelebrityHologramSearchResponse> Execute(CelebrityHologramSearchRequest request)
        {
            var responses = new List <CelebrityHologramSearchResponse>();

            switch (request.SearchType)
            {
            case CelebrityHologramSearchTypes.All:
                responses.AddRange(cContext.Get().Select(Mapper.Map));
                break;

            case CelebrityHologramSearchTypes.Specific:
                if (string.IsNullOrEmpty(request.CelebrityHologramRefrence))
                {
                    throw new BadRequestException("Required",
                                                  "CelebrityHologramRefrence is required for specific search");
                }

                var refrence = request.CelebrityHologramRefrence.Replace("CH", string.Empty);
                var refId    = 0;

                if (!int.TryParse(refrence, out refId))
                {
                    throw new InvalidException("Invalid",
                                               $"The provided refrence number {request.CelebrityHologramRefrence} is invalid.");
                }

                var response = cContext.Get(refId);

                if (response == null)
                {
                    throw new NotFoundException("Not found",
                                                $"The celebrity hologram is not avaialble for the provided referene {request.CelebrityHologramRefrence}");
                }

                responses.Add(Mapper.Map(response));
                break;
            }

            return(responses);
        }
 public List <CelebrityHologramSearchResponse> Search(CelebrityHologramSearchRequest request)
 {
     return(cContract.Search(request));
 }
 public List <CelebrityHologramSearchResponse> Search(CelebrityHologramSearchRequest request)
 {
     return(new CelebrityHologramSearchHandler(chsContext).Execute(request));
 }