public async Task <IActionResult> GetSurvey(string language) { IActionResult response; try { ModSurveys result = await _mongodb.ApiSurveys.GetSurvey(language); if (result?.Question.Length > 0) { response = Ok(result); } else { response = NoContent(); } } catch (Exception e) { response = ResponseErrorCode(); } return(response); }
public Task <string> InsertSurvey(ModSurveys survey) { _apiKeysCollection.InsertOne(survey); return(Task.FromResult(survey?.Id.ToString())); }