public override object[] GetContextConstructorArguments(IConnectionInfo cxInfo) { var mongoProps = new MongoLinqpadProperties(cxInfo); var mongoSessionType = typeof(MongoSession); var ctor = mongoSessionType.GetConstructor(new[] { typeof(string) }); var session = ctor.Invoke(new object[] { mongoProps.ConnectionString }); return new[] {session}; }
public MongoLinqpadPropsForm(IConnectionInfo cxInfo, bool isNewConnection) { this.cxInfo = cxInfo; this.isNewConnection = isNewConnection; Connection = new MongoLinqpadProperties(cxInfo); InitializeComponent(); }
public override IEnumerable<string> GetAssembliesToAdd() { var props = new MongoLinqpadProperties(_connectionInfo); var retVal = new List<string>() { Path.Combine(GetDriverFolder(), "MongoDB.Bson.dll"), Path.Combine(GetDriverFolder(), "MongoDB.Driver.dll"), Path.Combine(GetDriverFolder(), "MongoUtils.dll"), Path.Combine(GetDriverFolder(), "MongoLinqpadDriver.dll"), props.EntityAssemblyPath }; return retVal; }
public AssemblyBuilder(IConnectionInfo cxInfo, string driverFolder, AssemblyName assemblyToBuild, string nameSpace, string typeName) { _cxInfo = cxInfo; _driverFolder = driverFolder; _assemblyToBuild = assemblyToBuild; _nameSpace = nameSpace; _typeName = typeName; _mongoProps = new MongoLinqpadProperties(_cxInfo); _entityAssembly = Assembly.LoadFrom(_mongoProps.EntityAssemblyPath); _entityTypes = new List<Tuple<Type, string>>(); _collectionNames = GetCollectionNames(_mongoProps); _entityAssemblyNamespaces = _mongoProps.EntityAssemblyNamespaces.Split(';'); }
public override string GetConnectionDescription(IConnectionInfo connectionInfo) { _connectionInfo = connectionInfo; var props = new MongoLinqpadProperties(connectionInfo); return "MongoDb - " + props.ConnectionString; }
private IEnumerable<string> GetCollectionNames(MongoLinqpadProperties props) { var session = new MongoSession(props.ConnectionString); return session.GetCollectionNames(); }