I wrote this code in vb:
expireDate = (DateTime.Parse(decal.DecalExpireDate).ToShortDateString).ToString
Now I’m trying to write the same code in c#, this is what I came up with:
expireDate = decal.DecalExpireDate.ToString();
expireDate = DateTime.Parse(expireDate).ToShortDateString();
Does anybody know how to simplify the c# code so it’s one line and two. It’s bugging me that I can do it in one line with vb, but not in c#.
decal.DecalExpireDate is a smallDateTime that I’m retrieving with linq.
expireDate is a string that I’m returning in a function
Pretty much exactly how you had it in VB: