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

RegisterMessageType() private method

private RegisterMessageType ( Type messageType ) : MessageMetadata
messageType System.Type
return MessageMetadata
        MessageMetadata RegisterMessageType(Type messageType)
        {
            if (conventions.IsMessageType(messageType))
            {
                //get the parent types
                var parentMessages = GetParentTypes(messageType)
                    .Where(conventions.IsMessageType)
                    .OrderByDescending(PlaceInMessageHierarchy);

                var metadata = new MessageMetadata(messageType, new[]
                {
                    messageType
                }.Concat(parentMessages).ToArray());

                messages[messageType.TypeHandle] = metadata;

                return metadata;
            }
            return null;
        }