C#C
C#3y ago
SWEETPONY

❔ what is difference between _ and ()?

I have following in constuctor:
var initialize = ReactiveCommand.CreateFromTask( async () =>                     
 {                                                                                
     const string databaseFileName = "log.db";                                    
     var databaseFilePath = Path.Combine( Path.GetTempPath(), databaseFileName ); 
     var database = new SQLiteAsyncConnection(databaseFilePath);                  
                                                                                  
     await database.CreateTableAsync<MqttDelivery>();                             
 } );                                                                             
 initialize.Subscribe();                                                          
 initialize.Execute();                                                            

 var initialize = ReactiveCommand.CreateFromTask( async _ =>                     
 {                                                                                
     const string databaseFileName = "log.db";                                    
     var databaseFilePath = Path.Combine( Path.GetTempPath(), databaseFileName ); 
     var database = new SQLiteAsyncConnection(databaseFilePath);                  
                                                                                  
     await database.CreateTableAsync<MqttDelivery>();                             
 } );                                                                             
 initialize.Subscribe();                                                          
 initialize.Execute();     


the first one will be executed
second one will be skipped

why?
Was this page helpful?