File tree Expand file tree Collapse file tree
src/CometD.NetCore.Salesforce Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88* .user
99* .userosscache
1010* .sln.docstates
11- # *appsettings.Development.json
11+ * appsettings.Development.json
1212
1313# User-specific files (MonoDevelop/Xamarin Studio)
1414* .userprefs
Original file line number Diff line number Diff line change 1+ using CometD . NetCore . Salesforce ;
2+ using CometD . NetCore . Salesforce . ForceClient ;
3+ using Microsoft . Extensions . Configuration ;
4+ using Microsoft . Extensions . DependencyInjection ;
5+
6+ namespace Microsoft . Extensions . DependencyInjection
7+ {
8+ /// <summary>
9+ /// An extension method for <see cref="CometD.NetCore.Salesforce"/>.
10+ /// </summary>
11+ public static class StreamingClientExtensions
12+ {
13+ /// <summary>
14+ /// An Extension method to add <see cref="StreamingClient"/> dependencies.
15+ /// </summary>
16+ /// <param name="services"></param>
17+ /// <returns></returns>
18+ public static IServiceCollection AddStreamingClient ( this IServiceCollection services )
19+ {
20+ services . AddSingleton ( sp =>
21+ {
22+ var salesforceConfig = new SalesforceConfiguration ( ) ;
23+ var config = sp . GetRequiredService < IConfiguration > ( ) ;
24+
25+ config . Bind ( "Salesforce" , salesforceConfig ) ;
26+
27+ return salesforceConfig ;
28+ } ) ;
29+
30+ services . AddSingleton < IAuthenticationClientProxy , AuthenticationClientProxy > ( ) ;
31+ services . AddSingleton < IForceClientProxy , ForceClientProxy > ( ) ;
32+ services . AddSingleton < IStreamingClient , StreamingClient > ( ) ;
33+
34+ return services ;
35+ }
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments