Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
Questionapple push notification Pin
Member 108437285-Mar-18 20:22
Member 108437285-Mar-18 20:22 
AnswerRe: apple push notification Pin
Pete O'Hanlon5-Mar-18 20:28
mvePete O'Hanlon5-Mar-18 20:28 
GeneralRe: apple push notification Pin
Member 108437285-Mar-18 20:35
Member 108437285-Mar-18 20:35 
GeneralRe: apple push notification Pin
Pete O'Hanlon5-Mar-18 20:54
mvePete O'Hanlon5-Mar-18 20:54 
GeneralRe: apple push notification Pin
Member 108437285-Mar-18 21:11
Member 108437285-Mar-18 21:11 
GeneralRe: apple push notification Pin
Gerry Schmitz6-Mar-18 5:58
mveGerry Schmitz6-Mar-18 5:58 
QuestionTaskFactory Class Pin
Member 137105305-Mar-18 16:37
Member 137105305-Mar-18 16:37 
AnswerRe: TaskFactory Class Pin
Pete O'Hanlon5-Mar-18 20:20
mvePete O'Hanlon5-Mar-18 20:20 
There are a few issues with your code that you need to address. First, you are creating a list of tasks that you end up doing nothing with other than adding a single task. Why not just use that single task instead? Second issue, the StartNew is, essentially, fire and forget so you're calling it and letting the code fall back to the calling method immediately. You have nothing in there that's handling cases where the calling code errors out (for instance); to fix this, add something called a continuation that gets called when your task completes - you can handle your error cases in here for instance. Third, have you tested the core logic of the method inside the task to make sure that adds the data you would expect? Before moving your code into a task, it's generally worth seeing if the code runs successfully and only move it once you are sure it's rock solid.

What version of .NET are you using? It might be worth investigating using async/await and Task.Run if you can.
This space for rent

GeneralRe: TaskFactory Class Pin
Member 137105307-Mar-18 6:13
Member 137105307-Mar-18 6:13 
AnswerRe: TaskFactory Class Pin
Gerry Schmitz7-Mar-18 7:40
mveGerry Schmitz7-Mar-18 7:40 
GeneralRe: TaskFactory Class Pin
Member 1371053019-Mar-18 18:00
Member 1371053019-Mar-18 18:00 
Questionc# parsing CAN dbc files Pin
Member 135713645-Mar-18 4:05
Member 135713645-Mar-18 4:05 
AnswerRe: c# parsing CAN dbc files Pin
Maciej Los5-Mar-18 20:27
mveMaciej Los5-Mar-18 20:27 
GeneralRe: c# parsing CAN dbc files Pin
Member 135713645-Mar-18 20:34
Member 135713645-Mar-18 20:34 
Questiontextbox input Pin
User 136751143-Mar-18 13:01
User 136751143-Mar-18 13:01 
AnswerRe: textbox input Pin
BillWoodruff3-Mar-18 14:31
professionalBillWoodruff3-Mar-18 14:31 
GeneralRe: textbox input Pin
User 136751143-Mar-18 23:56
User 136751143-Mar-18 23:56 
GeneralRe: textbox input PinPopular
OriginalGriff4-Mar-18 1:21
mveOriginalGriff4-Mar-18 1:21 
GeneralRe: textbox input Pin
BillWoodruff4-Mar-18 2:18
professionalBillWoodruff4-Mar-18 2:18 
GeneralRe: textbox input Pin
Luc Pattyn4-Mar-18 7:19
sitebuilderLuc Pattyn4-Mar-18 7:19 
GeneralRe: textbox input Pin
OriginalGriff4-Mar-18 19:27
mveOriginalGriff4-Mar-18 19:27 
GeneralRe: textbox input Pin
Pete O'Hanlon4-Mar-18 20:56
mvePete O'Hanlon4-Mar-18 20:56 
GeneralRe: textbox input Pin
OriginalGriff4-Mar-18 21:04
mveOriginalGriff4-Mar-18 21:04 
GeneralRe: textbox input Pin
Pete O'Hanlon4-Mar-18 21:10
mvePete O'Hanlon4-Mar-18 21:10 
QuestionHow to create a recursive lambda function ? Pin
Jesus Carroll2-Mar-18 12:26
professionalJesus Carroll2-Mar-18 12:26 

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.