i have a stored procedure,from sp i want to get data in Var OverAllsecures varriable.
how to use sp in my in web api method.
async Task<DashboardData> IDashboardManager.GetDashBoardReport(int jobId) { var OverAllsecures = //Here i want to fetch data from stored procedure in this variable
var ApprovalEngDeliverable = _dbContext.Deliverable.Where(k => k.DeliverableTypeId == 1 && k.JobId == jobId).ToList(); var InfoEngDeliverable = _dbContext.Deliverable.Where(k => k.DeliverableTypeId == 2 && k.JobId == jobId).ToList(); var totalEngDeliverable = ApprovalEngDeliverable.Count + InfoEngDeliverable.Count; return await Task.Run(() => { return new DashboardData() { TotalEngDeliverableCount = (int)totalEngDeliverable, TotalApprovalEngDeliverableCount = (int)ApprovalEngDeliverable.Count, TotalInfoEngDeliverableCount = (int)InfoEngDeliverable.Count,
OverallScurve = //Output data i.e OverAllsecures from sp will be assigned
}; });
----------------This my Class----------------
public class DashboardData { //Eng Deliverable public int TotalEngDeliverableCount { get; set; } public int TotalApprovalEngDeliverableCount { get; set; } public int TotalInfoEngDeliverableCount { get; set; }
public OverAllsecure OverallScurve { get; set; } }
public class OverAllsecure {
public List<int> target { get; set; }
public List<int> acheived { get; set; } public List<string> Mnth_Yr { get; set; }
}
Kindly helo as soon as possible