123456789101112131415161718192021222324 |
- using ClassLibrary1;
- using System;
- using System.Linq;
- using System.Reflection;
- namespace ConsoleApp4
- {
- class Program
- {
- static void Main(string[] args)
- {
- Assembly assembly = Assembly.GetCallingAssembly();
- var typesWithMyAttribute =
- from t in assembly.GetTypes()
- let attributes = t.GetCustomAttributes(typeof(CosmosDBAttribute), false)
- where attributes != null && attributes.Length > 0
- select new { Type = t, Attributes = attributes.Cast<CosmosDBAttribute>() };
- Console.WriteLine("Hello World!");
- }
- }
- }
|