Posts

Showing posts from June, 2023

Asp.net core MVC Session

Image
  public class MyController : Controller {   // Define an action method to handle the AJAX request   [HttpPost] // or [HttpGet] depending on your configuration   public ActionResult DropdownChanged(string selectedValue)   {     // Perform any necessary actions based on the selected value     // and return the updated data or a JSON response.     // Example logic:     if (selectedValue == "option1")     {       // Do something when Option 1 is selected     }     else if (selectedValue == "option2")     {       // Do something when Option 2 is selected     }     else if (selectedValue == "option3")     {       // Do something when Option 3 is selected     }     // Return the updated data or a JSON response.   } } <select id="myDropdown">   <option value="option1">Option ...

Pub Sub Service in asp.net core

 Controller using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc; using QHSE.Services.Common; using System.Collections.Generic; using Microsoft.AspNetCore.Mvc; using Microsoft.Azure.WebJobs.Extensions.WebPubSub; using Azure.Messaging.WebPubSub; using Microsoft.Extensions.Configuration; using System.Threading.Tasks; using System; using Microsoft.Graph; namespace QHSE.API.Controllers.Common {     [Route("api/alerts")]     [ApiController]     public class AlertController : ControllerBase     {         private readonly IAlertService _alertService;         private readonly WebPubSubServiceClient _serviceClient;         private readonly string _hubName;         public AlertController(IAlertService alertService, IConfiguration configuration)         {             _alertService = ...