Example #1
0
        public bool AddSport(Sport sport)
        {
            var sportDto = new SportDto();

            sportDto = convert.ToSportDto(sport);
            var model = new bool();

            using (var client = new ToteService.BetListServiceClient())
            {
                try
                {
                    client.Open();
                    model = client.AddSport(sportDto);
                    client.Close();
                }
                catch (FaultException <CustomException> customEx)
                {
                    log.Error(customEx.Message);
                    return(false);
                }
                catch (CommunicationException commEx)
                {
                    log.Error(commEx.Message);
                    return(false);
                }
            }
            return(model);
        }