Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public async Task<UserLiveScores> GetUserProgressScreenScoresAsync(string userID)
- {
- UserLiveScores result;
- using (var connection = new SqlConnection(_connectionString))
- {
- await connection.OpenAsync();
- var p = new DynamicParameters();
- p.Add("@organizerUserId", userID);
- p.Add("@feedbackScore", dbType: DbType.Int32, direction: ParameterDirection.Output);
- p.Add("@genderSplitScore", dbType: DbType.Int32, direction: ParameterDirection.Output);
- p.Add("@organizationFeedbackScore", dbType: DbType.Int32, direction: ParameterDirection.Output);
- p.Add("@organizationGenderSplitScore", dbType: DbType.Int32, direction: ParameterDirection.Output);
- await connection.ExecuteAsync(GetUserOrganizationScoreSp, p, commandType: CommandType.StoredProcedure);
- result = new UserLiveScores
- {
- GenderFitnessScore = (p.Get<int?>("@feedbackScore") ?? 0) + (p.Get<int?>("@genderSplitScore") ?? 0),
- FeedbackScore = p.Get<int?>("@feedbackScore") ?? 0,
- GenderSplitScore = p.Get<int?>("@genderSplitScore") ?? 0,
- OrganizationGenderFitnessScore = p.Get<int>("@organizationFeedbackScore") + p.Get<int>("@organizationGenderSplitScore"),
- OrganizationFeedbackScore = p.Get<int>("@organizationFeedbackScore"),
- OrganizationGenderSplitScore = p.Get<int>("@organizationGenderSplitScore")
- };
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement