skip to Main Content

Timeout when Connecting to MongoDB Atlas from Azure App Service

I'm trying to connect to my MongoDB database using the following setup: public ReplybotServiceLayer(MongoDbSettings databaseSettings) { var connectionString = $"mongodb+srv://{databaseSettings.User}:{databaseSettings.Password}@{databaseSettings.Cluster}.mongodb.net/{DatabaseName}?w=majority&connect=replicaSet"; var client = new MongoClient(connectionString); var database = client.GetDatabase(DatabaseName); _guildResponsesCollection = database.GetCollection<GuildResponseEntity>("responses"); _guildConfigurationsCollection = database.GetCollection<GuildConfigurationEntity>("configuration"); } public async Task<IList<TriggerResponse>?> GetResponsesForGuild(ulong…

VIEW QUESTION

Deserialize JSON with comma-separated values

I want to de-serialize a JSON where a node contains values which comma-separated. But the object which contains the comma returns null when deserializing. Input JSON: { "SolutionTabletSubSectionUId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "SolutionTabletSubSectionId": 1, "SolutionTabletUId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Title": "string", "SubTitle": "string", "Description": "string", "Link":…

VIEW QUESTION

how to pass float type to url in c#? – Asp.net

in client side : <script type="text/javascript"> function ShowDetailPopup(FPS_Code, PhaseNo) { popup.SetContentUrl("test4.aspx?id=" + FPS_Code + "&PhaseNo=" + PhaseNo); popup.Show(); } </script> in server side: using (SqlConnection con = new SqlConnection(strcon1)) { SqlCommand cmd = new SqlCommand("SELECT ID,DocumentNo,ReleaseNo,PhaseNo,FPS_Code,DrawingNo FROM Project1 WHERE FPS_Code=@FPS_Code…

VIEW QUESTION

How to pass JSON array in body of web api c#

I am trying to capture a JSON array of string from POST Request in web api. [HttpPost] [Route("")] public async Task<IHttpActionResult> CancelItems([FromBody] List<string> items) { //codes } But I am getting null in items. Post Body: { "items":[ "1034908029943809497", "1034908029943809494"…

VIEW QUESTION
Back To Top
Search