Click here to Skip to main content
15,891,529 members
Home / Discussions / C#
   

C#

 
GeneralRe: Incomplete data after trapping Date Pin
Richard Deeming8-Dec-15 8:30
mveRichard Deeming8-Dec-15 8:30 
GeneralRe: Incomplete data after trapping Date Pin
OriginalGriff8-Dec-15 8:33
mveOriginalGriff8-Dec-15 8:33 
GeneralRe: Incomplete data after trapping Date Pin
Robert Kamarowski8-Dec-15 8:43
Robert Kamarowski8-Dec-15 8:43 
GeneralRe: Incomplete data after trapping Date Pin
Robert Kamarowski8-Dec-15 10:25
Robert Kamarowski8-Dec-15 10:25 
GeneralRe: Incomplete data after trapping Date Pin
Richard Deeming9-Dec-15 2:56
mveRichard Deeming9-Dec-15 2:56 
GeneralRe: Incomplete data after trapping Date Pin
Robert Kamarowski9-Dec-15 5:07
Robert Kamarowski9-Dec-15 5:07 
QuestionTask.ContinueWith Return Value Pin
Kevin Marois8-Dec-15 5:19
professionalKevin Marois8-Dec-15 5:19 
AnswerRe: Task.ContinueWith Return Value Pin
Richard Deeming8-Dec-15 6:04
mveRichard Deeming8-Dec-15 6:04 
Try this:
C#
public Task<Dictionary<int, string>> GetAllNamesAsync()
{
    Task<IList<InternalProviderViewDto>> task = Client.GetAsync(new InternalProviderSearch());
    return task.ContinueWith(t => t.Result.ToDictionary(i => i.Id, i => i.Name));
}

If you're using .NET 4.5, you could use async and await instead:
C#
public async Task<Dictionary<int, string>> GetAllNamesAsync()
{
    IList<InternalProviderViewDto> results = await Client.GetAsync(new InternalProviderSearch());
    return results.ToDictionary(i => i.Id, i => i.Name));
}




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Task.ContinueWith Return Value Pin
Dave Kreskowiak8-Dec-15 6:09
mveDave Kreskowiak8-Dec-15 6:09 
GeneralRe: Task.ContinueWith Return Value Pin
Kevin Marois8-Dec-15 6:22
professionalKevin Marois8-Dec-15 6:22 
AnswerRe: Task.ContinueWith Return Value Pin
Dave Kreskowiak8-Dec-15 6:08
mveDave Kreskowiak8-Dec-15 6:08 
GeneralRe: Task.ContinueWith Return Value Pin
Kevin Marois8-Dec-15 6:23
professionalKevin Marois8-Dec-15 6:23 
GeneralRe: Task.ContinueWith Return Value Pin
Dave Kreskowiak8-Dec-15 7:20
mveDave Kreskowiak8-Dec-15 7:20 
QuestionMessage Removed Pin
7-Dec-15 15:59
Eilson Tang7-Dec-15 15:59 
AnswerMessage Removed Pin
7-Dec-15 16:38
professionalBillWoodruff7-Dec-15 16:38 
GeneralMessage Removed Pin
7-Dec-15 16:43
Eilson Tang7-Dec-15 16:43 
GeneralMessage Removed Pin
7-Dec-15 16:56
professionalBillWoodruff7-Dec-15 16:56 
QuestionThreads and Dispatcher Pin
Member 121764286-Dec-15 6:23
Member 121764286-Dec-15 6:23 
AnswerRe: Threads and Dispatcher Pin
Richard Deeming7-Dec-15 1:22
mveRichard Deeming7-Dec-15 1:22 
Questionhow Select a DataGridView row after TextBox value c# Pin
Carlos_paiva5-Dec-15 0:58
Carlos_paiva5-Dec-15 0:58 
AnswerRe: how Select a DataGridView row after TextBox value c# Pin
OriginalGriff5-Dec-15 1:23
mveOriginalGriff5-Dec-15 1:23 
QuestionMaking a program that converts speech to text Pin
Member 120871384-Dec-15 19:10
Member 120871384-Dec-15 19:10 
AnswerRe: Making a program that converts speech to text Pin
BillWoodruff4-Dec-15 22:55
professionalBillWoodruff4-Dec-15 22:55 
Questionhow to update the datagrid present on c# gui from c# dll. Pin
Member 93228874-Dec-15 7:49
Member 93228874-Dec-15 7:49 
AnswerRe: how to update the datagrid present on c# gui from c# dll. Pin
Eddy Vluggen4-Dec-15 7:58
professionalEddy Vluggen4-Dec-15 7:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.