public CustomODataRoute( string routePrefix, ODataPathRouteConstraint pathConstraint, HttpRouteValueDictionary defaults, HttpRouteValueDictionary constraints, HttpRouteValueDictionary dataTokens, HttpMessageHandler handler) : base(routePrefix, pathConstraint, defaults, constraints, dataTokens, handler) { _canGenerateDirectLink = routePrefix != null && RoutePrefix.IndexOf('{') == -1; }
public string OffSet(string ipAddress, bool v6 = false, int offset = 0, bool hasPrefix = false) { var route = new RoutePrefix(ipAddress); if (route.StartOfPrefixBigInt % 2 != 0) { if (!v6) { return(hasPrefix ? $"{(route.StartOfPrefixBigInt + offset).ToIpAddress(AddressFamily.InterNetwork)}/{route.PrefixMaskWidth}" : (route.StartOfPrefixBigInt + offset).ToIpAddress(AddressFamily.InterNetwork) .ToString()); } } return(hasPrefix ? $"{(route.StartOfPrefixBigInt + offset).ToIpAddress(AddressFamily.InterNetworkV6)}/{route.PrefixMaskWidth}" : (route.StartOfPrefixBigInt + offset).ToIpAddress(AddressFamily.InterNetworkV6).ToString()); }
public CustomODataRoute(string routePrefix, ODataPathRouteConstraint pathConstraint) : base(routePrefix, pathConstraint) { _canGenerateDirectLink = routePrefix != null && RoutePrefix.IndexOf('{') == -1; }