BasicARMWebAPI.Utils.ResourceUtilities.GetDeploymentFromId C# (CSharp) Method

GetDeploymentFromId() public static method

public static GetDeploymentFromId ( string id ) : string
id string
return string
        public static string GetDeploymentFromId(string id)
        {
            var segments = id.Split('/');

            if (segments.Count() < 6 || !(segments[5].Equals("deployments", StringComparison.InvariantCultureIgnoreCase)) || segments[6].Length == 0)
            {
                throw new InvalidOperationException("There is not a vaild deployment present in this Id");
            }

            return segments[6];
        }