Heat the olive oil to 350°F.
Slowly add the sliced shallots to the oil and fry until golden brown.
Remove the onions, place on a paper towel, and lightly salt them.
In a pan over medium heat, melt the butter and add the mushrooms.
Lightly salt and sauté the mushrooms for 4-5 minutes.
Add the garlic and sauté for another 2-3 minutes.
Stir the flour into the pan with the mushrooms and garlic and cook for another 1-2 minutes.
Whisk in the chicken stock and cream.
Add salt and pepper to taste.
Continue to cook the cream sauce until it reduces and thickens.
Mix the green beans and some of the fried shallots into the cream sauce.
Pour the creamy green beans into a baking dish.
Place the dish in the oven at 350°F for 30 minutes.
Add the rest of the fried shallots over the casserole and place back in the oven for another 10 minutes.
Remove from the oven and let cool for a few minutes.