private async Task <Message> HandleMessageAsync(Message message) { var state = messageRegister.RegisterMessage(message); if (state is UserStates.SecondLevel) { return(await Task.Run(() => SecondLevel(message))); } else { return(await FirstLevel(message)); } }
public static void Register(IMessageRegister register) { register.RegisterMessage <ClassA, ClassA>(1); register.RegisterMessage <ClassA>(2); }