forked from SolrNet/SolrNet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
structuremap solr intergration update to standard 2.0
- Loading branch information
Ciprian_Mocanu
committed
Jan 25, 2018
1 parent
caa1a04
commit 5cd850e
Showing
14 changed files
with
116 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<configuration> | ||
|
||
<configSections> | ||
<section name="solr" type="StructureMap.SolrNetIntegration.Config.SolrConfigurationSection, StructureMap.SolrNetIntegration"/> | ||
</configSections> | ||
<appSettings> | ||
<add key="bla" value="alb"/> | ||
</appSettings> | ||
<solr> | ||
<server id="entity" url="http://localhost:8983/solr/collection1" documentType="StructureMap.SolrNetIntegration.Tests.Entity, StructureMap.SolrNetIntegration.Tests"/> | ||
<server id="entity2" url="http://localhost:8983/solr/core0" documentType="StructureMap.SolrNetIntegration.Tests.Entity2, StructureMap.SolrNetIntegration.Tests"/> | ||
<server id="entity3" url="http://localhost:8983/solr/core1" documentType="StructureMap.SolrNetIntegration.Tests.Entity2, StructureMap.SolrNetIntegration.Tests"/> | ||
</solr> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/> | ||
</startup> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"solr": { | ||
"SolrServerElements": [ | ||
{ | ||
"id": "entity", | ||
"url": "http://localhost:8983/solr/collection1", | ||
"documentType": "StructureMap.SolrNetIntegration.Tests.Entity, StructureMap.SolrNetIntegration.Tests" | ||
}, | ||
{ | ||
"id": "entity2", | ||
"url": "http://localhost:8983/solr/core0", | ||
"documentType": "StructureMap.SolrNetIntegration.Tests.Entity2, StructureMap.SolrNetIntegration.Tests" | ||
}, | ||
{ | ||
"id": "entity3", | ||
"url": "http://localhost:8983/solr/core1", | ||
"documentType": "StructureMap.SolrNetIntegration.Tests.Entity2, StructureMap.SolrNetIntegration.Tests" | ||
} | ||
] | ||
} | ||
} |
12 changes: 0 additions & 12 deletions
12
StructureMap.SolrNetIntegration/Config/SolrConfigurationSection.cs
This file was deleted.
Oops, something went wrong.
29 changes: 11 additions & 18 deletions
29
StructureMap.SolrNetIntegration/Config/SolrServerElement.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,30 @@ | ||
using System.Configuration; | ||
|
||
| ||
namespace StructureMap.SolrNetIntegration.Config | ||
{ | ||
public class SolrServerElement : ConfigurationElement | ||
public class SolrServerElement | ||
{ | ||
private const string ID = "id"; | ||
private const string URL = "url"; | ||
private const string DOCUMENT_TYPE = "documentType"; | ||
|
||
[ConfigurationProperty(ID, IsKey = true, IsRequired = true)] | ||
public string Id | ||
{ | ||
get { return base[ID].ToString(); } | ||
set { base[ID] = value; } | ||
get; | ||
set; | ||
} | ||
|
||
[ConfigurationProperty(URL, IsKey = true, IsRequired = true)] | ||
public string Url | ||
public string Url | ||
{ | ||
get { return base[URL].ToString(); } | ||
set { base[URL] = value; } | ||
get; | ||
set; | ||
} | ||
|
||
[ConfigurationProperty(DOCUMENT_TYPE, IsKey = true, IsRequired = true)] | ||
public string DocumentType | ||
{ | ||
get { return base[DOCUMENT_TYPE].ToString(); } | ||
set { base[DOCUMENT_TYPE] = value; } | ||
get; | ||
set; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return string.Format("Id: {0} Url: {1} DocType: {2}", Id, Url, DocumentType); | ||
return $"Id: {Id} Url: {Url} DocType: {DocumentType}"; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.