/// <summary> /// Add Linq2Couchbase support to the cluster. /// </summary> /// <param name="options">Options to extend.</param> /// <param name="setupAction">Action to apply additional configuration to <see cref="CouchbaseLinqConfiguration"/>.</param> /// <returns>The <see cref="ClusterOptions"/> to allow chaining.</returns> public static ClusterOptions AddLinq(this ClusterOptions options, Action <CouchbaseLinqConfiguration>?setupAction) { var configuration = new CouchbaseLinqConfiguration(); setupAction?.Invoke(configuration); return(options .AddClusterService(configuration.DocumentFilterManager) .AddClusterService <ISerializationConverterProvider, ISerializationConverterProvider>(configuration.SerializationConverterProviderFactory)); }
public static CouchbaseLinqConfiguration WithJsonNetConverterProvider( this CouchbaseLinqConfiguration configuration, Action <TypeBasedSerializationConverterRegistry>?registryConfigurationAction) { return(configuration.WithSerializationConverterProvider(serviceProvider => { var registry = TypeBasedSerializationConverterRegistry.CreateDefaultRegistry(); registryConfigurationAction?.Invoke(registry); return new DefaultSerializationConverterProvider( serviceProvider.GetRequiredService <ITypeSerializer>(), registry); })); }
public static CouchbaseLinqConfiguration WithJsonNetConverterProvider( this CouchbaseLinqConfiguration configuration, IJsonNetSerializationConverterRegistry registry) => configuration.WithSerializationConverterProvider(
public static CouchbaseLinqConfiguration WithJsonNetConverterProvider( this CouchbaseLinqConfiguration configuration) => configuration.WithJsonNetConverterProvider((Action <TypeBasedSerializationConverterRegistry>?)null);