Example #1
0
        public UscfMember LookupById(LookupByIdRequest lookupByIdRequest)
        {
            var lookupResult = MobileApi.LookupById(lookupByIdRequest);

            var mobileApiResult = new List <MobileApiResult>(new[] { lookupResult });

            var searchResult = ProcessSearchResults(mobileApiResult).FirstOrDefault();

            return(searchResult == null
                ? null
                : new UscfMember
            {
                FirstName = searchResult.FirstName,
                LastName = searchResult.LastName,
                Suffix = searchResult.Suffix,
                StateOrCountry = searchResult.StateOrCountry,
                UscfId = lookupResult.UscfId,
                MembershipExpirationDate = lookupResult.MembershipExpirationDate,
                MembershipStatus = lookupResult.MembershipStatus,
                Comments = lookupResult.Comments,
                BlitzRating = lookupResult.BlitzRating,
                RegularRating = lookupResult.RegularRating,
                QuickRating = lookupResult.QuickRating
            });
        }
Example #2
0
        // the logic here should be like this:
        // Go to the mobile api and run search eigther by the name/state, or by id.
        // if the name has more than 2 parts, then use desktop search using the id in question.
        // Desktop site returns the names in the form last name, first name, so it is easy to reconstruct the original first and last name
        public IEnumerable <UscfSearchRecord> SearchByName(SearchByNameRequest searchByNameRequest)
        {
            var mobileApiResult = MobileApi.SearchByName(searchByNameRequest).ToList();

            return(ProcessSearchResults(mobileApiResult));
        }