Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: cset-2541 fix .NET warnings #3703

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public NodeNotFound(string message, Exception innerException) : base(message, in
{
}

protected NodeNotFound(SerializationInfo info, StreamingContext context) : base(info, context)
protected NodeNotFound(SerializationInfo info, StreamingContext context)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
using System.Collections.Generic;
using System.Linq;
using CSETWebCore.DataLayer.Model;
using CSETWebCore.Helpers;
using Nelibur.ObjectMapper;
using CSETWebCore.Interfaces.Helpers;
using CSETWebCore.Interfaces.Question;
using CSETWebCore.Model.Question;
using Microsoft.AspNetCore.Http;
using Snickler.EFCore;

namespace CSETWebCore.Business.Question
Expand Down Expand Up @@ -253,7 +252,7 @@ public int StoreAnswer(Answer answer)
(answer.QuestionType == "Question" && !_context.NEW_QUESTION.Any(q => q.Question_Id == answer.QuestionId))
|| (answer.QuestionType == "Requirement" && !_context.NEW_REQUIREMENT.Any(r => r.Requirement_Id == answer.QuestionId))
|| (answer.QuestionType == "Component" && !_context.COMPONENT_QUESTIONS.Any(c => c.Question_Id == answer.QuestionId))
|| (answer.QuestionType == "Maturity" && !_context.MATURITY_QUESTIONS.Any(m => m.Mat_Question_Id == answer.QuestionId))
|| (answer.QuestionType == "Maturity" && !_context.MATURITY_QUESTIONS.Any(m => m.Mat_Question_Id == answer.QuestionId))
)
{
throw new Exception("Unknown question or requirement ID: " + answer.QuestionId);
Expand Down Expand Up @@ -324,7 +323,8 @@ public int StoreAnswer(Answer answer)
/// <param name="resp"></param>
public void BuildComponentsResponse(QuestionResponse resp)
{
var list = _context.usp_Answer_Components_Default(this.AssessmentId).Cast<Answer_Components_Base>().ToList();
var answerComponents = _context.usp_Answer_Components_Default(this.AssessmentId);
var list = answerComponents.Select(component => TinyMapper.Map<Answer_Components_Base>(component)).ToList();
//.Where(x => x.Assessment_Id == this.assessmentID).Cast<Answer_Components_Base>()
//.OrderBy(x => x.Question_Group_Heading).ThenBy(x => x.Universal_Sub_Category).ToList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Net.Http.Headers;
using CSETWebCore.DataLayer.Model;
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.AspNetCore.Http;

namespace CSETWebCore.Api.Controllers
{
Expand Down Expand Up @@ -105,7 +106,7 @@ from ft in tt.DefaultIfEmpty()

var contentDisposition = new ContentDispositionHeaderValue("inline");
contentDisposition.FileName = filename;
Response.Headers.Add("Content-Disposition", contentDisposition.ToString());
Response.Headers.Append("Content-Disposition", contentDisposition.ToString());

return File(stream, contentType);
}
Expand Down
Loading