private Athlete FillEntity(AthleteViewModel viewModel, out string message)
        {
            var entity = new Athlete();

            if (viewModel.Validate(viewModel, out message))
            {
                var city = cityTasks.Get(viewModel.CityId);
                var healthCarePlan = healthCarePlanTasks.Get(viewModel.HealthCarePlanId);
                var neighborhood = neighborhoodTasks.Get(viewModel.NeighborhoodId);

                entity.City = city;
                entity.Neighborhood = neighborhood;
                entity.HealthCarePlan = healthCarePlan;
                entity.Address = viewModel.Address.ToUpper();
                entity.AddressComplement = string.IsNullOrEmpty(viewModel.AddressComplement) ? "" : viewModel.AddressComplement.ToUpper();
                entity.AllergiesDiseases = string.IsNullOrEmpty(viewModel.AllergiesDiseases) ? "" : viewModel.AllergiesDiseases.ToUpper();
                entity.BirthDate = viewModel.BirthDate;
                entity.BloodType = viewModel.BloodType;
                entity.Cellphone = viewModel.Cellphone;
                entity.Cpf = viewModel.Cpf;
                entity.CpfPath = viewModel.CpfPath;
                entity.Email = viewModel.Email;
                entity.Experience = viewModel.Experience;
                entity.FgrCardNumber = viewModel.FgrCardNumber;
                entity.FgrCardPath = viewModel.FgrCardPath;
                entity.FirstTrainingDate = viewModel.FirstTrainingDate;
                entity.Gender = viewModel.Gender;
                entity.HealthCarePlanCardNumber = viewModel.HealthCarePlanCardNumber;
                entity.HealthCarePlanCardPath = viewModel.HealthCarePlanCardPath;
                entity.Height = viewModel.Height;
                entity.InjuriesHistory = string.IsNullOrEmpty(viewModel.InjuriesHistory) ? "" : viewModel.InjuriesHistory.ToUpper();
                entity.IrbLawsPath = viewModel.IrbLawsPath;
                entity.IrbReadyPath = viewModel.IrbReadyPath;
                entity.MedicalAttestPath = viewModel.MedicalAttestPath;
                entity.Name = viewModel.Name.ToUpper();
                entity.Position = viewModel.Position;
                entity.Rg = viewModel.Rg;
                entity.RgPath = viewModel.RgPath;
                entity.Telephone = viewModel.Telephone;
                entity.UrgencyContactName = viewModel.UrgencyContactName.ToUpper();
                entity.UrgencyContactTelephone = viewModel.UrgencyContactTelephone;
                entity.Weight = viewModel.Weight;
            }

            return entity;
        }
        public static AthleteViewModel Convert(Athlete entity)
        {
            var viewModel = new AthleteViewModel();

            if (null == entity)
            {
                return viewModel;
            }

            viewModel.Id = entity.Id;
            viewModel.Name = entity.Name;
            viewModel.BirthDate = entity.BirthDate;
            viewModel.Gender = entity.Gender;
            viewModel.Weight = entity.Weight;
            viewModel.Height = entity.Height;
            viewModel.FirstTrainingDate = entity.FirstTrainingDate;
            viewModel.Position = entity.Position;
            viewModel.Experience = entity.Experience;
            viewModel.Telephone = entity.Telephone;
            viewModel.Cellphone = entity.Cellphone;
            viewModel.Email = entity.Email;
            viewModel.UrgencyContactName = entity.UrgencyContactName;
            viewModel.UrgencyContactTelephone = entity.UrgencyContactTelephone;
            viewModel.Address = entity.Address;
            viewModel.AddressComplement = entity.AddressComplement;
            viewModel.CityId = entity.City.Id;
            viewModel.NeighborhoodId = entity.Neighborhood.Id;
            viewModel.HealthCarePlanId = entity.HealthCarePlan.Id;
            viewModel.BloodType = entity.BloodType;
            viewModel.InjuriesHistory = entity.InjuriesHistory;
            viewModel.AllergiesDiseases = entity.AllergiesDiseases;
            viewModel.Cpf = entity.Cpf;
            viewModel.CpfPath = entity.CpfPath;
            viewModel.Rg = entity.Rg;
            viewModel.RgPath = entity.RgPath;
            viewModel.FgrCardNumber = entity.FgrCardNumber;
            viewModel.FgrCardPath = entity.FgrCardPath;
            viewModel.IrbLawsPath = entity.IrbLawsPath;
            viewModel.IrbReadyPath = entity.IrbReadyPath;
            viewModel.MedicalAttestPath = entity.MedicalAttestPath;
            viewModel.HealthCarePlanCardPath = entity.HealthCarePlanCardPath;
            viewModel.HealthCarePlanCardNumber = entity.HealthCarePlanCardNumber;
            viewModel.CreatedOn = entity.CreatedOn;

            return viewModel;
        }