Seed data commented for Attachments and SurveyResponse

This commit is contained in:
Santhosh S 2023-09-04 22:04:58 -04:00
parent cc4b58d072
commit 4d6ae0f0f8
4 changed files with 9 additions and 8 deletions

View File

@ -35,12 +35,12 @@ var app = builder.Build();
// Configure the HTTP request pipeline. // Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment()) if (app.Environment.IsDevelopment())
{ {
using (var serviceScope = app.Services.CreateScope()) //using (var serviceScope = app.Services.CreateScope())
{ //{
var services = serviceScope.ServiceProvider; // var services = serviceScope.ServiceProvider;
var answerProvider = services.GetRequiredService<IAnswersProvider>(); // var answerProvider = services.GetRequiredService<IAnswersProvider>();
answerProvider.SeedData(); // answerProvider.SeedData();
} //}
app.UseSwagger(); app.UseSwagger();
app.UseSwaggerUI( app.UseSwaggerUI(
options => options =>

View File

@ -13,5 +13,6 @@ namespace DamageAssesment.Api.Attachments.Interfaces
Task<(bool IsSuccess, int counter, string Path)> DeleteBulkAttachmentsAsync(int responseId, List<int> answerIds); Task<(bool IsSuccess, int counter, string Path)> DeleteBulkAttachmentsAsync(int responseId, List<int> answerIds);
Task<(bool IsSuccess, int counter, string message)> GetAttachmentCounter(); Task<(bool IsSuccess, int counter, string message)> GetAttachmentCounter();
Task<(bool IsSuccess, IEnumerable<Models.Attachment> Attachments, string ErrorMessage)> GetAttachmentInfo(List<AnswerInfo> answers); Task<(bool IsSuccess, IEnumerable<Models.Attachment> Attachments, string ErrorMessage)> GetAttachmentInfo(List<AnswerInfo> answers);
} }
} }

View File

@ -21,7 +21,7 @@ namespace DamageAssesment.Api.Attachments.Providers
this.logger = logger; this.logger = logger;
this.mapper = mapper; this.mapper = mapper;
this.uploadservice = uploadservice; this.uploadservice = uploadservice;
SeedData(); // SeedData();
} }
public async Task<(bool IsSuccess, IEnumerable<Models.Attachment> Attachments, string ErrorMessage)> GetAttachmentsAsync() public async Task<(bool IsSuccess, IEnumerable<Models.Attachment> Attachments, string ErrorMessage)> GetAttachmentsAsync()
{ {

View File

@ -38,7 +38,7 @@ namespace DamageAssesment.Api.SurveyResponses.Controllers
/// GET request for retrieving survey responses by survey ID. /// GET request for retrieving survey responses by survey ID.
/// </summary> /// </summary>
[HttpGet("{surveyId}")] [HttpGet("surveys/{surveyId}")]
public async Task<ActionResult> GetSurveyResponsesAsync(int surveyId) public async Task<ActionResult> GetSurveyResponsesAsync(int surveyId)
{ {
var result = await this.surveyResponseProvider.GetSurveyResponsesBySurveyAsync(surveyId); var result = await this.surveyResponseProvider.GetSurveyResponsesBySurveyAsync(surveyId);