abstract class UpdateContentBase { }
class MessageUpdate : UpdateContentBase { }
class CallbackQueryUpdate : UpdateContentBase { }
New Update class:
interface IUpdate<out T> where T : UpdateContentBase, new() {
T Content { get; }
}
class Update<T> : IUpdate<T> where T : UpdateContentBase, new() {
public T Content { get; }
public Update(T content) {
Content = content;
}
}
It would be nicer to handle updates of a specific type.
Cleaner code:
Possible implementation:
Update Types:
New Update class: