I would like to understand the IL code a bit.
So as you see the expression bodied has less code than the GetOld code. Is it some optimization done there and means expression body syntax is more performant?
Or it does not really matter?
namespace DatabaseModules {
public class Test {
public IList<string> _cache = new List<string>();
public Test() {
}
public IList<string> Get => _cache;
public IList<string> GetOld {
get { return _cache; }
}
}
}
And the generated IL Code using DotPeek
https://gist.github.com/anonymous/9673389a1a21d0ad8122ec97178cfd9a