Click here to Skip to main content
13,767,091 members

.NET Framework

 
GeneralRe: need tutor online for .net core and sql server with msbi and azure deployment Pin
Dave Kreskowiak13-Dec-17 3:12
mvpDave Kreskowiak13-Dec-17 3:12 
AnswerRe: need tutor online for .net core and sql server with msbi and azure deployment Pin
Dave Kreskowiak13-Dec-17 3:14
mvpDave Kreskowiak13-Dec-17 3:14 
Questionreverse a function Pin
cootechgy11-Dec-17 12:24
membercootechgy11-Dec-17 12:24 
AnswerRe: reverse a function Pin
Eddy Vluggen11-Dec-17 12:56
professionalEddy Vluggen11-Dec-17 12:56 
AnswerRe: reverse a function Pin
Dave Kreskowiak11-Dec-17 16:27
mvpDave Kreskowiak11-Dec-17 16:27 
QuestionAre there any limitations to Microsoft Word Doc conversion to HTML? Pin
Eagle329-Dec-17 4:36
memberEagle329-Dec-17 4:36 
AnswerRe: Are there any limitations to Microsoft Word Doc conversion to HTML? Pin
Dave Kreskowiak9-Dec-17 5:34
mvpDave Kreskowiak9-Dec-17 5:34 
QuestionWhy does Task.Factory not do what it's supposed to do? Pin
Wiep Corbier26-Nov-17 20:45
memberWiep Corbier26-Nov-17 20:45 
I have an eight core computer and therefor I can have a tasklist with 8 tasks.
But not al 8 task are perform correctly or something else doesn't work.

My objective: I want 8 count results be shown on a website (MVC) so I have 8 different methods that get the 8 result seperatly.

One method is like this:
protected void GetArticleCount()
{
    ArticlesManager articlesManager = new ArticlesManager();
    ViewBag.ArticlesCount = articlesManager.ArticleCount();
}


And so there are 7 more.

My code to collect all 8 is like this:

var t1 = Task.Factory.StartNew(() => GetArticleCount());
var t2 = Task.Factory.StartNew(() => GetBrancheCount());
var t3 = Task.Factory.StartNew(() => GetCompaniesCount());
var t4 = Task.Factory.StartNew(() => GetDeliveriesCount());
var t5 = Task.Factory.StartNew(() => GetDistributionCentresCount());
var t6 = Task.Factory.StartNew(() => GetDocksCount());
var t7 = Task.Factory.StartNew(() => GetInvoicesCount());
var t8 = Task.Factory.StartNew(() => GetOrdersCount());

var taskList = new List<Task> { t1, t2, t3, t4, t5, t6, t7, t8 };
Task.WaitAll(taskList.ToArray());


When I run it 5 off the 8 are visible on my website and the remaining 3 are also shown after a refresh (F5).

When I run the code without the "Task.Factory" but sequentially, all 8 are shown immediately.

Question: why? What's wrong with my code?
AnswerRe: Why does Task.Factory not do what it's supposed to do? Pin
Richard MacCutchan26-Nov-17 22:35
protectorRichard MacCutchan26-Nov-17 22:35 
GeneralRe: Why does Task.Factory not do what it's supposed to do? Pin
Wiep Corbier26-Nov-17 22:44
memberWiep Corbier26-Nov-17 22:44 
AnswerRe: Why does Task.Factory not do what it's supposed to do? Pin
Gerry Schmitz27-Nov-17 4:29
memberGerry Schmitz27-Nov-17 4:29 
GeneralRe: Why does Task.Factory not do what it's supposed to do? Pin
Wiep Corbier27-Nov-17 8:00
memberWiep Corbier27-Nov-17 8:00 
GeneralRe: Why does Task.Factory not do what it's supposed to do? Pin
Gerry Schmitz27-Nov-17 8:52
memberGerry Schmitz27-Nov-17 8:52 
QuestionRead XLM data using Key in powershell Pin
Member 1338745922-Nov-17 22:54
memberMember 1338745922-Nov-17 22:54 
AnswerRe: Read XLM data using Key in powershell Pin
Richard MacCutchan22-Nov-17 23:53
protectorRichard MacCutchan22-Nov-17 23:53 
Questionerror: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
RAGHUNATH45616-Nov-17 5:31
memberRAGHUNATH45616-Nov-17 5:31 
AnswerRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
Richard MacCutchan16-Nov-17 6:14
protectorRichard MacCutchan16-Nov-17 6:14 
GeneralRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
RAGHUNATH45616-Nov-17 23:10
memberRAGHUNATH45616-Nov-17 23:10 
GeneralRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
Richard MacCutchan16-Nov-17 23:40
protectorRichard MacCutchan16-Nov-17 23:40 
GeneralRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
Dominic Burford12-Dec-17 3:47
professionalDominic Burford12-Dec-17 3:47 
GeneralRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
tJackydx29-Nov-17 4:33
membertJackydx29-Nov-17 4:33 
AnswerRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
Dominic Burford12-Dec-17 3:46
professionalDominic Burford12-Dec-17 3:46 
QuestionProblem validating data input to a DataTable Pin
Ernesto R.D.8-Nov-17 18:54
memberErnesto R.D.8-Nov-17 18:54 
AnswerRe: Problem validating data input to a DataTable Pin
Eddy Vluggen9-Nov-17 0:45
professionalEddy Vluggen9-Nov-17 0:45 
GeneralRe: Problem validating data input to a DataTable Pin
Ernesto R.D.9-Nov-17 1:57
memberErnesto R.D.9-Nov-17 1:57 

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.


Advertise | Privacy | Cookies | Terms of Service
Web06-2016 | 2.8.181114.1 | Last Updated 16 Nov 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid