private IMongoEntityModel GetEntityModel <TEntity>() { var model = _modelSource.GetModel(this).Entities.GetOrDefault(typeof(TEntity)); if (model == null) { throw new CafException("Could not find a model for given entity type: " + typeof(TEntity).AssemblyQualifiedName); } return(model); }