Click here to Skip to main content
14,602,044 members

.NET (Core and Framework)

 
GeneralRe: need tutor online for .net core and sql server with msbi and azure deployment Pin
Dave Kreskowiak13-Dec-17 2:12
mveDave Kreskowiak13-Dec-17 2:12 
AnswerRe: need tutor online for .net core and sql server with msbi and azure deployment Pin
Dave Kreskowiak13-Dec-17 2:14
mveDave Kreskowiak13-Dec-17 2:14 
Questionreverse a function Pin
cootechgy11-Dec-17 11:24
Membercootechgy11-Dec-17 11:24 
AnswerRe: reverse a function Pin
Eddy Vluggen11-Dec-17 11:56
professionalEddy Vluggen11-Dec-17 11:56 
AnswerRe: reverse a function Pin
Dave Kreskowiak11-Dec-17 15:27
mveDave Kreskowiak11-Dec-17 15:27 
QuestionAre there any limitations to Microsoft Word Doc conversion to HTML? Pin
Eagle329-Dec-17 3:36
MemberEagle329-Dec-17 3:36 
AnswerRe: Are there any limitations to Microsoft Word Doc conversion to HTML? Pin
Dave Kreskowiak9-Dec-17 4:34
mveDave Kreskowiak9-Dec-17 4:34 
QuestionWhy does Task.Factory not do what it's supposed to do? Pin
Wiep Corbier26-Nov-17 19:45
MemberWiep Corbier26-Nov-17 19: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 21:35
mveRichard MacCutchan26-Nov-17 21:35 
GeneralRe: Why does Task.Factory not do what it's supposed to do? Pin
Wiep Corbier26-Nov-17 21:44
MemberWiep Corbier26-Nov-17 21:44 
AnswerRe: Why does Task.Factory not do what it's supposed to do? Pin
Gerry Schmitz27-Nov-17 3:29
mveGerry Schmitz27-Nov-17 3:29 
GeneralRe: Why does Task.Factory not do what it's supposed to do? Pin
Wiep Corbier27-Nov-17 7:00
MemberWiep Corbier27-Nov-17 7:00 
GeneralRe: Why does Task.Factory not do what it's supposed to do? Pin
Gerry Schmitz27-Nov-17 7:52
mveGerry Schmitz27-Nov-17 7:52 
QuestionRead XLM data using Key in powershell Pin
Member 1338745922-Nov-17 21:54
MemberMember 1338745922-Nov-17 21:54 
AnswerRe: Read XLM data using Key in powershell Pin
Richard MacCutchan22-Nov-17 22:53
mveRichard MacCutchan22-Nov-17 22:53 
Questionerror: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
RAGHUNATH45616-Nov-17 4:31
MemberRAGHUNATH45616-Nov-17 4:31 
AnswerRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
Richard MacCutchan16-Nov-17 5:14
mveRichard MacCutchan16-Nov-17 5:14 
GeneralRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
RAGHUNATH45616-Nov-17 22:10
MemberRAGHUNATH45616-Nov-17 22:10 
GeneralRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
Richard MacCutchan16-Nov-17 22:40
mveRichard MacCutchan16-Nov-17 22:40 
GeneralRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
Dominic Burford12-Dec-17 2:47
professionalDominic Burford12-Dec-17 2:47 
GeneralRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
tJackydx29-Nov-17 3:33
MembertJackydx29-Nov-17 3:33 
AnswerRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
Dominic Burford12-Dec-17 2:46
professionalDominic Burford12-Dec-17 2:46 
QuestionProblem validating data input to a DataTable Pin
Ernesto R.D.8-Nov-17 17:54
MemberErnesto R.D.8-Nov-17 17:54 
AnswerRe: Problem validating data input to a DataTable Pin
Eddy Vluggen8-Nov-17 23:45
professionalEddy Vluggen8-Nov-17 23:45 
GeneralRe: Problem validating data input to a DataTable Pin
Ernesto R.D.9-Nov-17 0:57
MemberErnesto R.D.9-Nov-17 0: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.