Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static StreamReader GetFileTypesResource()
- {
- const string resourceName = "FileTypes.csv";
- var resourceFullName = Assembly
- .GetExecutingAssembly()
- .GetManifestResourceNames()
- .FirstOrDefault(name => name.EndsWith(resourceName, StringComparison.InvariantCultureIgnoreCase))
- ?? throw new InvalidOperationException($"Can't find resource name with ends with '{resourceName}'");
- var stream = Assembly
- .GetExecutingAssembly()
- .GetManifestResourceStream(resourceFullName)
- ?? throw new InvalidOperationException($"Can't find resource with name '{resourceFullName}'");
- return new StreamReader(stream);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement