public async Task<Utils.TReportReturn> GetReportDataColumnSettings(AdminTechnicianReportInput input)
{
input.CustomerId = m_customerId;
input.UserId = m_userId;
input.TimeOffset = m_timeOffset;
TReportReturn objTReportReturn = new TReportReturn();
objTReportReturn.ReportColumns = await new ReportsEntityContext().GetTechniciansReportColumns<AdminTechnicianReportInput>(input);
objTReportReturn.ReportSettings = await new ReportsEntityContext().GetGeneralSettingsData<AdminTechnicianReportInput>(input);
objTReportReturn.ReportData = await new ReportsDbContext().GetUserListDynamic<AdminTechnicianReportInput>(input);
return objTReportReturn;
}
public class HomeController : Controller
{
public ActionResult Index()
{
AdminTechnicianReportInput objInput = new AdminTechnicianReportInput();
objInput.CustomerId = 1;
objInput.UserId = 5477;
objInput.AddUpdateUserid = 0;
objInput.intRowsPerPage = 200;
objInput.intPageIndex = 0;
objInput.intTarget = 0;
objInput.intStatusId = 0;
objInput.strSearchQuery = "";
objInput.strSortColumn = "Id";
objInput.strSortDirection = "ASC";
var result = new ReportsModel(1, 5477, 0).Administration.AdminTechnicianReport.GetReportDataColumnSettings(objInput).Result;
ViewBag.Title = result.ReportSettings.CustomerName + "__" + result.ReportSettings.PrintedOn;
return View();
}
}
The GetReportDataColumnSettings function calls many async methods which is the the model library dll.
Index() method in HomeController is an mvc method and I want to get the return in the result variable. Itried getawaiter().getmethod(), but it didn't worked.
I do not prefer to change the Index() method as asynk Task. Please suggest another way to get the result