public static T GetSingelService <T>(this IServicePool source, [Required] IServiceMetadata metadata) where T : class, IService { return(source.GetFirstOrDefault <T>( m => m.Metadata.Contracts == metadata.Contracts && m.Metadata.Descriptor == metadata.Descriptor && m.Metadata.ToString() == metadata.ToString())); }
private static T GetSingelDefauldService <T>(this IServicePool source) where T : class, IService { return(source.GetFirstOrDefault <T>(m => m.Metadata.Contracts.Any(f => f == typeof(T)))); }
public static T GetSingelService <T>(this IServicePool source, string descriptor) where T : class, IService { return (source.GetFirstOrDefault <T>( m => m.Metadata.Contracts.Any(f => f == typeof(T)) && m.Metadata.Descriptor == descriptor)); }