Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# return task list

private async Task<List<Item>> GetListAsync(){
  	//Create a list object and assign it to a new task
  	//which returns your list object
    List<Item> list = await Task.Run(() => manager.GetList());
  
  	return list;
  
  	//Or you may just need to await something and just return a list
	await SomeMethod();
	List<Item> list1 = new List<Item>();
 
    return list;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to save a dictionary as a csv file in c# 
Csharp :: how to cap rigidbody velocity 
Csharp :: valid URL check in c# 
Csharp :: unity create empty gameobject in code 
Csharp :: calling stored procedure in c# entity framework 
Csharp :: The entity type has multiple properties with the [Key] attribute. 
Csharp :: asp.net core mvc jsonresult example 
Csharp :: get list length c# 
Csharp :: unity3d find y position on navmesh 
Csharp :: c# get last day of month 
Csharp :: how to add headers to scripts in unity 
Csharp :: integer required asp.net core 
Csharp :: on collision enter by layer 2d unity 
Csharp :: constructor c# 
Csharp :: else if c# 
Csharp :: c# merge two xml files 
Csharp :: contains duplicate 
Csharp :: c# get the first 4 characters in the list 
Csharp :: text read C# 
Csharp :: save image in c# 
Csharp :: what is a model in c# 
Csharp :: input unity 
Csharp :: sorting a datatable in c# 
Csharp :: map user to ConnectionId SignalR 
Csharp :: if c# 
Csharp :: unity render to texture2d 
Csharp :: how to find player gameobject in unity 
Csharp :: c# Dictionary contains key case insensitive 
Csharp :: switch statement c# example 
Csharp :: return an interface or a class C# 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =