Exemplo n.º 1
0
 public static bool HasAnnotation(this IAnnotated annotated, Type type) => annotated.Annotations(type)?.Any() == true;
Exemplo n.º 2
0
 public static IEnumerable <A> Annotations <A>(this IAnnotated annotated) => annotated.Annotations(typeof(A))?.Cast <A>() ?? Enumerable.Empty <A>();
Exemplo n.º 3
0
 public static bool TryGetAnnotation <A>(this IAnnotated annotated, out A annotation) where A : class
 {
     annotation = annotated.Annotations <A>()?.FirstOrDefault();
     return(annotation != null);
 }
Exemplo n.º 4
0
 public static object Annotation(this IAnnotated annotated, Type type) => annotated.Annotations(type)?.FirstOrDefault();
Exemplo n.º 5
0
 public static bool TryGetAnnotation(this IAnnotated annotated, Type type, out object annotation)
 {
     annotation = annotated.Annotations(type)?.FirstOrDefault();
     return(annotation != null);
 }