Answer the question
In order to leave comments, you need to log in
How to get rid of long loading MongoDB?
Hello!
I am making a small messenger and using MongoDB as a database. But connecting to the database wildly slows down the launch of the application. Is it possible to fix this somehow. Tried to make an asynchronous method, but it didn't work.
The constructor of the class in which I connect to the database.
public DataBase()
{
var client = new MongoClient(connectionString);
database = client.GetDatabase("Sliderer");
}
private DataBase data;
public MainWindow()
{
InitializeComponent();
data = new DataBase();
}
Answer the question
In order to leave comments, you need to log in
Well, asynchrony will not help here, because apparently the designers themselves slow down.
All I can advise is to build in Release and ReadyToRun.
You can also try to initialize the database after showing the windows, and until the connection is established, show the spinner.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question