public IBaseMapper <T> Create(T obj) { AddToBsonClassMap(obj); obj._id = ObjectId.GenerateNewId(); // sometimes adding to classmap does not add _t property to the document // will also need to define our own type discriminator as we need to retrieve the value of it to do // reflection, it requires namespace and class name, otherwise Type.GetType() may return null. // this also allows us to do our own custom filtering by class type. obj.ClassType = obj.GetType().FullName; Uow.RegisterNew(CollectionName, obj.ToBsonDocument()); return(this); }