CQRSMicroservices.Web.Middleware.Extensions.GetExtension C# (CSharp) Метод

GetExtension() публичный статический Метод

Gets the extension of a path string without the . (so: NewPerson.command will return "command")
public static GetExtension ( this pathString ) : string
pathString this The path string.
Результат string
    public static string GetExtension(this PathString pathString)
    {
      if(pathString.HasValue)
      {
        string value = pathString.Value;
        int pos = value.LastIndexOf('.');
        if(pos > 0)
        {
          return value.Substring(pos + 1);
        }
      }
      return null;
    }
  }
Extensions