How to Prevent .NET MVC Url.Action() Method from Inserting ID in a Route

Listen to this text

I had this issue that took me a solid two hours to debug. I thought I’d quickly write about it for the common good, in case it saves collective time for humanity: time that can be better wasted on other non-productive endeavors, like refreshing reddit, or reading some awful blog (not this one of course).

It appears that the Url.Action() method in MVC will take whatever current value is in the ID field on your browser, and sometimes plug this into a new route, even when you are explicitly not doing so.

For instance, Suppose you navigate to a route /User/Profile/855 where 855 is the ID. And you want a link to just /User/Profile/(no id). Well, if you use Url.Action() is will “helpfully”, put the 855 id in there for you, even if you ask nicely not to. It’s like a toddler trying to be helpful while you make coffee and so you let them hold the measuring cup with all the coffee grounds and then instead of putting it in the coffee maker, they miss and drop it all on the floor. But… I digress 🙂

So, the way to force MVC’s Url.Action() method to NOT do this, is quite simple, you just put in an empty string when constructing the action, so in this example it’s just:

@Url.Action("Profile", "User", new { id = "" })

7 ways to have no side effects after Covid Vaccine Dose 2

Listen to this text

It’s now 48 hours after my second Pfizer Covid vaccine. I’m happy to report that side-effects were incredibly mild. My arm did not feel sore until about 8-12 hours after my shot. At first, I questioned whether they gave me a placebo, since I was expecting — at minimum — some arm soreness. The soreness did arrive, but it was very mild. It didn’t affect me much; I was able to use my arm as I normally do with a little less bounce; I skipped on any heavy lifting or weight lifting. After about 12 hours after dose 2 I felt a little more tired than usual. Not debilatingly tired, but tired enough that I went to bed about an hour earlier than I normally do 9:30PM — probably the time I should bed (I usually go to bed at 11pm and wake up at 6:40AM).

The next day I think was the day my immune system was actually starting to activate and build up more antibodies. 24 hours after the shot, the side effects were mild enough that it didn’t affect my day, but I did feel a little more run-down than usual: I felt a touch light-headed at times, a touch more sluggish, and at times I felt a little warm (which was remedied by simply wearing a t-shirt). That’s it! That was all the side effects. I heard folks in my age group (I’m 38) feel really sick after the 2nd shot. But, I felt fine. There were side-effects but they were surprisingly milder than I anticipated. I took no advil or tylenol, but I did drink a ridiculous amount of water from an hour before through 48 hours after my shot.

So, in list fashion, here’s what I recommend you do to minimize side effects from 24 hours before your shot to 48 hours after:

  1. Drink Water

    Drink 32oz of water an hour before your shot. It’s a lot of water, and you should probably use the bathroom before your shot; and you’ll probably need to use it again right after. And then slowly drink 32 ounces of “extra” water than your normally do each day, for the next 48 hours. But drink it very slowly as in, 32 oz over the course of an hour or two, so as not to dilute the natural electrolytes in your body and overload your kidneys. Listen to your body, though. Drinking too much water can lead to hyponatremia, so just listen to your body. If you feel like your forcing yourself, stop. Take-in extra salted nuts to keep your sodium in-check. Being well-hydrated is probably the most important thing you can do.

  2. Sleep

    Get 8-9 hours of sleep the day of your shot, and the next 2 consecutive nights. Harder to do if you have little kids, but maybe your partner can help?

  3. Go Vegan

    Eat plant-based, with extra fresh fruits and vegetables, with extra emphasis on fruits with a higher concentration of vitamin-c (kiwis, oranges, grapefruits)

  4. Take Vitamin D & C

    Increase your vitamin-D through supplements or fortified milks. Vitamin-D and vitamin C is integral to the immune system. Vitamin-C is easy to get, but we are often deficient in Vitamin D, so do make sure your getting the daily recommended amount on that one.

  5. Eat light

    Eat very light meals (salads, oatmeal, vegetables, fruits). No processed foods or junk. Everything you consume should be high quality.

  6. No Alchohol

    This probably goes without saying but I’ll say it: don’t drink any alcohol!

  7. Skip the Gym

    Skip exercise during this period. Or, if you must, do something very light. I have often found that if I ever feel like I’m about to have a cold and I exercise the day before, I am almost sure the cold will get worse the next day. I think when your immune system is activated, it’s best to keep all external stressors you can control on the body to a bare minimum.

Covid-19 – Dose 2!

Listen to this text

I just got my second dose of Pfizer’s Covid shot today! I’m excited that I’m just 14 days away from hardcore immunity! I’m a little worried that the side effects, of which I’m anticipating, will knock me out for 24-48 hours. Everyone in my age-group seems to get them after the 2nd dose, due to youths’ more “robust immune response” (whatever that means). Right now, surprisingly I feel great! I had that shot at 10AM, and it’s now 2PM, and I feel nothing … not even arm soreness (which I had after my first dose).

Well, in my effort to do something to counteract the side effects I drank about 96 ounces of water since my shot. I’ve had to go to the bathroom, maybe 20 times now! Let’s see if the water and my vegan diet and general good fitness level will keep my afloat and on my A-game to keep up with my fierce little toddlers at home tonight.