public static string GetEventName(this EventTypeMapper mapper, Type type)
        {
            if (!mapper.TryGetEventName(type, out var name))
            {
                throw new Exception($"Failed to find name mapped with '{type}'");
            }

            return(name);
        }
Пример #2
0
        public static Type GetEventType(this EventTypeMapper mapper, string name)
        {
            if (!mapper.TryGetEventType(name, out var type))
            {
                throw new Exception($"Failed to find type mapped with '{name}'");
            }

            return(type);
        }
 public static EventTypeMapper Map <T>(this EventTypeMapper mapper, string name) => mapper.Map(typeof(T), name);