public static MessageBusConfigurator RegisterMongoSagaType <TSaga>(this MessageBusConfigurator cfg) { cfg.RegisterSagaType(typeof(TSaga)); if (!BsonClassMap.IsClassMapRegistered(typeof(TSaga))) { BsonClassMap.RegisterClassMap <TSaga>(x => { x.AutoMap(); x.SetIgnoreExtraElements(true); }); } return(cfg); }