public DateTime Date => DateTime.Now;
public DateTime Date { get => DateTime.Now; }
Is there a difference between the two or is it equivalent code with different syntax?
public DateTime Date => DateTime.Now;
public DateTime Date { get => DateTime.Now; }
Is there a difference between the two or is it equivalent code with different syntax?
Both ways result in the same IL.
For
the abbreviated IL for both versions is (I used https://sharplab.io):