-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove anything to do with SponsorLink
- Loading branch information
Showing
7 changed files
with
59 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/EntityFrameworkCore.Generator.Core/AssemblyMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System.Reflection; | ||
|
||
namespace EntityFrameworkCore.Generator; | ||
|
||
public static class AssemblyMetadata | ||
{ | ||
private static readonly Lazy<string> _fileVersion = new(() => | ||
{ | ||
var assembly = typeof(AssemblyMetadata).Assembly; | ||
var attribute = assembly.GetCustomAttribute<AssemblyFileVersionAttribute>(); | ||
return attribute?.Version; | ||
}); | ||
|
||
private static readonly Lazy<string> _assemblyVersion = new(() => | ||
{ | ||
var assembly = typeof(AssemblyMetadata).Assembly; | ||
var attribute = assembly.GetCustomAttribute<AssemblyVersionAttribute>(); | ||
return attribute?.Version; | ||
}); | ||
|
||
private static readonly Lazy<string> _informationVersion = new(() => | ||
{ | ||
var assembly = typeof(AssemblyMetadata).Assembly; | ||
var attribute = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>(); | ||
return attribute?.InformationalVersion; | ||
}); | ||
|
||
private static readonly Lazy<string> _assemblyDescription = new(() => | ||
{ | ||
var assembly = typeof(AssemblyMetadata).Assembly; | ||
var attribute = assembly.GetCustomAttribute<AssemblyDescriptionAttribute>(); | ||
return attribute?.Description; | ||
}); | ||
|
||
private static readonly Lazy<string> _assemblyName = new(() => | ||
{ | ||
var assembly = typeof(AssemblyMetadata).Assembly; | ||
return assembly.GetName().Name; | ||
}); | ||
|
||
public static string FileVersion => _fileVersion.Value; | ||
|
||
public static string AssemblyVersion => _assemblyVersion.Value; | ||
|
||
public static string AssemblyDescription => _assemblyDescription.Value; | ||
|
||
public static string AssemblyName => _assemblyName.Value; | ||
|
||
public static string InformationalVersion => _informationVersion.Value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters