Preheat a pan on medium/medium-low heat and add the butter. Once the butter is melted and starting to bubble, add the shallots and sauté for a minute or so. Add your mushrooms and sauté those as well, maybe 3 minutes. If the pan is dry and the mushrooms aren't cooking well, add another tablespoon of butter.
Add the cream, stock, oregano, and thyme. Whisk that together and let it come to a simmer. Add about 3/4 of the grated cheese and whisk that in. Then add the cornstarch slurry and bring it to a simmer again, whisking constantly. The slurry will thicken the sauce, but only after it comes to a simmer, so make sure you bring it up to a full simmer before shutting off the heat. Once it simmers and has thickened, turn off the heat, add the bacon and stir. Add a pinch or two of salt if using unsalted stock, taste and adjust seasonings accordingly.
Put your asparagus in a bowl and add the sauce. Stir to coat evenly, and transfer to a baking dish.
To make this the night before: Cover it and store it in the fridge at this point. Preheat your oven to 350 degrees, cover with tin foil, and bake for 40-45 minutes. Remove the casserole and turn the heat up to 450 degrees. Remove the tin foil and top the casserole with the fried onions and the rest of the grated cheese and bake for another 10-15 minutes, until cheese is bubbly and top is beginning to brown.
To make this the day of: Preheat your oven to 350, cover with tin foil, bake for 45-50 minutes, then do as mentioned above (bump heat to 450, remove tin foil, add onion and cheese, bake another 10-15).