public static TService GetServiceByContext <TService>(this IComponentContext ctx) { var serviceKey = ctx.GetServiceKey <TService>(); return(ctx.ResolveKeyed <TService>(serviceKey)); }