コード例 #1
0
        public IDiscoverySettings ToModel(DiscoverySettingsContract contract)
        {
            var model = _modelFactory.CreateDiscoverySettings();

            model.ShowMe = (Gender)((int) contract.ShowMe);
            model.DiscoveryEnabled = contract.DiscoveryEnabled;
            model.SearchDistanceMiles = contract.SearchDistanceMiles;
            model.SearchLocationLatitude = contract.SearchLocationLatitude;
            model.SearchLocationLongitude = contract.SearchLocationLongitude;
            model.ShowAgeMax = contract.ShowAgeMax;
            model.ShowAgeMin = contract.ShowAgeMin;

            return model;
        }
コード例 #2
0
        public DiscoverySettingsContract ToContract(IDiscoverySettings model)
        {
            var contract = new DiscoverySettingsContract
            {
                DiscoveryEnabled = model.DiscoveryEnabled,
                SearchLocationLongitude = model.SearchLocationLongitude,
                SearchLocationLatitude = model.SearchLocationLatitude,
                ShowAgeMax = model.ShowAgeMax,
                ShowAgeMin = model.ShowAgeMin,
                ShowMe = (GenderContract) ((int) model.ShowMe),
                SearchDistanceMiles = model.SearchDistanceMiles
            };

            return contract;
        }