Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working in mvc 5 with entity frame work from last one years i created many separate async services before its working fine but now i dont know why its suddenly stopped working? when ever i try to fetch the data from data base through repository its give me the wrong data for some column when i go to database table and checking the column values its fine but in service some column values are not correct.can any one help me why this happens????

see one my function in my service this is sample code.
C#
public async Task<bool> Assign(hs_Program_Assignment programAssignment)
        {

            programAssignment.HPA_AssignedByID = CurrentUserId;
            programAssignment.HPA_DateAssigned = DateTime.Now;
            programAssignment.HPA_Source = ModuleSource.Activity;
            var Program = clientUnitOfWork.ProgramRepository.GetByID(programAssignment.HPA_SourceID);

}

What I have tried:

i am using task.run() and task.factory but still having the same issue.
Posted
Comments
Kornfeld Eliyahu Peter 21-Feb-16 9:08am    
Any errors? Any debugging?
Kamar Shahzad 21-Feb-16 9:55am    
no , no error.
[no name] 21-Feb-16 11:53am    
Any environment configuration changes? Secondly you can log your data where it is probem either it is async function or repository function side.

Thirdly you can call the repository method without async and see whether you are getting correct value.
Kamar Shahzad 21-Feb-16 13:18pm    
no environment changes when i execute the same code in controller its working but when i use my service its not working.i don't know why this happend

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900