C#

C#

Made by DeepSource

Consider using typeof(T).Assembly to get currently executing assembly CS-P1018

Performance
Critical

As the name suggests, Assembly.GetExecutingAssembly() returns the executing assembly. However, this is not an efficient way. Consider using typeof(T).Assembly instead.

Bad Practice

var assembly = Assembly.GetExecutingAssembly();

Recommended

var assembly = typeof(T).Assembly;

Reference