Skip to content

Commit

Permalink
🚧 #40 #41add repository entity to service constructor
Browse files Browse the repository at this point in the history
add default neo4j query to default if the uses the default constructor
  • Loading branch information
italopessoa committed Mar 24, 2018
1 parent 95dea9c commit c816fca
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace BitcoinShow.Neo4j.Repository.Interface
/// <summary>
/// Neo4j Repository definition
/// </summary>
internal interface INeo4jRepository : IDisposable
public interface INeo4jRepository : IDisposable
{
/// <summary>
/// Create a new node
Expand Down
9 changes: 9 additions & 0 deletions src/BitcoinShow.Neo4j.Repository/Neo4jRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ public class Neo4jRepository : INeo4jRepository
{
private readonly IDriver _driver;

/// <summary>
/// Default constructor
/// </summary>
/// <remarks>Uses bolt://127.0.0.1:7687 as default uri.</remarks>
public Neo4jRepository()
{
_driver = GraphDatabase.Driver("bolt://127.0.0.1:7687", AuthTokens.None);
}

/// <summary>
/// Constructor
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<ItemGroup>
<ProjectReference Include="..\BitcoinShow.Neo4j.Core\BitcoinShow.Neo4j.Core.csproj" />
<ProjectReference Include="..\BitcoinShow.Neo4j.Repository\BitcoinShow.Neo4j.Repository.csproj" />
</ItemGroup>

</Project>
7 changes: 6 additions & 1 deletion src/BitcoinShow.Neo4j.Service/Neo4jService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
using System.Threading.Tasks;
using BitcoinShow.Neo4j.Service.Interface;
using BitcoinShow.Neo4j.Core;
using BitcoinShow.Neo4j.Repository.Interface;

namespace BitcoinShow.Neo4j.Service
{
public class Neo4jService : INeo4jService
{
public Neo4jService()
private readonly INeo4jRepository _repository;

public Neo4jService(INeo4jRepository repository)
{
_repository = repository;
}

public async Task<QuestionNode> CreateQuestionAsync(QuestionNode question)
Expand Down

0 comments on commit c816fca

Please sign in to comment.