Skip to content

Commit a643f01

Browse files
Ihar YakimushIhar Yakimush
authored andcommitted
config sample
2 parents c485410 + 631c8a8 commit a643f01

File tree

5 files changed

+7
-14
lines changed

5 files changed

+7
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# solr-net-linq
2-
SolrNet IQueryable provider
2+
SolrNet IQueryable provider. Extend SolrNet functionality by adding limited LINQ to SOLR support.
33

44
## Code Sample
55
### Prerequisites

SolrNet.IntegrationOData/Product.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,5 @@ public class Product
3636

3737
[SolrField("inStock_b")]
3838
public bool InStock { get; set; }
39-
40-
public static Lazy<ISolrOperations<Product>> SolrOperations = new Lazy<ISolrOperations<Product>>(() =>
41-
{
42-
IServiceCollection services = new ServiceCollection();
43-
services.AddSolrNet("http://localhost:8983/solr/demo");
44-
45-
return services.BuildServiceProvider().GetRequiredService<ISolrOperations<Product>>();
46-
}, LazyThreadSafetyMode.ExecutionAndPublication);
4739
}
4840
}

SolrNet.IntegrationOData/Startup.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public Startup(IConfiguration configuration)
2525
public void ConfigureServices(IServiceCollection services)
2626
{
2727
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
28+
services.AddSolrNet("http://localhost:8983/solr/demo");
2829
}
2930

3031
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@@ -35,7 +36,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
3536
app.UseDeveloperExceptionPage();
3637
}
3738

38-
app.UseMvc();
39+
app.UseMvcWithDefaultRoute();
3940
}
4041
}
4142
}

SolrNet.Linq/SolrNet.Linq.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
<Description>SolrNet IQueryable provider</Description>
1010
<PackageLicenseUrl>https://github.com/IharYakimush/solr-net-linq/blob/master/LICENSE</PackageLicenseUrl>
1111
<PackageProjectUrl>https://github.com/IharYakimush/solr-net-linq</PackageProjectUrl>
12-
<PackageTags>solr linq</PackageTags>
12+
<PackageTags>solr solrnet linq</PackageTags>
1313
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1414
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1515
<Version>1.1.0</Version>
1616
<PackageReleaseNotes>ability to customize field serializer</PackageReleaseNotes>
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="SolrNet.Core" Version="1.0.10" />
20+
<PackageReference Include="SolrNet.Core" Version="1.0.0" />
2121
</ItemGroup>
2222

2323
</Project>

SolrNet.Linq/TypeSystem.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
namespace SolrNet.Linq
55
{
6-
public static class TypeSystem
6+
internal static class TypeSystem
77
{
8-
public static Type GetElementType(Type seqType)
8+
internal static Type GetElementType(Type seqType)
99
{
1010
Type ienum = FindEnumerable(seqType);
1111
if (ienum == null)

0 commit comments

Comments
 (0)