示例#1
0
        public static IUrlNamedLocation GetLocationByUrlSegment(this ILocationQuery locationQuery, Country country, string segment, string suffix)
        {
            var locationUrlName = GetUrlName(segment, suffix);

            return(locationUrlName != null
                ? locationQuery.ResolveUrlNamedLocation(country, locationUrlName)
                : null);
        }
示例#2
0
        public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            var locationUrlName = GetLocationUrlName(bindingContext);

            return(locationUrlName != null
                ? _locationQuery.ResolveUrlNamedLocation(ActivityContext.Current.Location.Country, locationUrlName)
                : null);
        }