NServiceBus.Unicast.Messages.MessageMetadataRegistry.PlaceInMessageHierarchy C# (CSharp) Method

PlaceInMessageHierarchy() static private method

static private PlaceInMessageHierarchy ( Type type ) : int
type System.Type
return int
        static int PlaceInMessageHierarchy(Type type)
        {
            if (type.IsInterface)
            {
                return type.GetInterfaces().Length;
            }
            var result = 0;

            while (type.BaseType != null)
            {
                result++;

                type = type.BaseType;
            }

            return result;
        }