https://github.com/devpro/yanport-dotnet-client
  
  
    .NET Core client for Yanport 
    https://github.com/devpro/yanport-dotnet-client
  
dotnet-core nuget real-estate rest-client yanport
        Last synced: 8 months ago 
        JSON representation
    
.NET Core client for Yanport
- Host: GitHub
- URL: https://github.com/devpro/yanport-dotnet-client
- Owner: devpro
- License: apache-2.0
- Created: 2020-03-04T17:25:35.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-22T04:16:19.000Z (over 2 years ago)
- Last Synced: 2024-05-28T00:40:55.455Z (over 1 year ago)
- Topics: dotnet-core, nuget, real-estate, rest-client, yanport
- Language: C#
- Size: 58.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 20
- 
            Metadata Files:
            - Readme: README.md
- License: LICENSE
 
Awesome Lists containing this project
README
          # Yanport .NET Client
[](https://dev.azure.com/devprofr/open-source/_build/latest?definitionId=35&branchName=master)
[](https://sonarcloud.io/dashboard?id=devpro.yanport.dotnetclient)
[](https://sonarcloud.io/dashboard?id=devpro.yanport.dotnetclient)
.NET client for [Yanport](https://www.yanport.com/), provider of real estate data.
Package | Version | Type
------- | ------- | ----
`Devpro.Yanport.Abstractions` | [](https://www.nuget.org/packages/Devpro.Yanport.Abstractions/) | .NET Standard 2.1
`Devpro.Yanport.Client` | [](https://www.nuget.org/packages/Devpro.Yanport.Client/) | .NET Standard 2.1
## How to use
- Have the [NuGet package](https://www.nuget.org/packages/Devpro.Yanport.Client) in your csproj file (can be done manually, with Visual Studio or through nuget command)
```xml
  
    
  
```
- Make the code changes to be able to use the library (config & service provider)
```csharp
// implement the configuration interface (for instance in a configuration class in your app project) or use DefaultYanportClientConfiguration
using Devpro.Yanport.Client;
public class AppConfiguration : IYanportClientConfiguration
{
    // explicitely choose where to take the configuration for Yanport REST API (this is the responibility of the app, not the library)
}
// configure your service provider (for instance in your app Startup class)
using Devpro.Yanport.Client.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection()
  .AddLogging()
  .AddYanportClient(Configuration);
```
- Use the repositories (enjoy a simple, yet optimized, HTTP client)
```csharp
using Devpro.Yanport.Client;
private readonly IPropertRepository _propertyRepository;
public MyService(IPropertRepository propertyRepository)
{
    _propertyRepository = propertyRepository;
}
public async Task GetProperties()
{
    var properties = await _propertyRepository.FindAllAsync();
}
```
## How to build
Once the git repository has been cloned, execute the following commands from the root directory:
```bash
dotnet restore
dotnet build
```
## How to test
For integration tests, to manage the configuration (secrets) you can create a file at the root directory called `Local.runsettings` or define them as environment variables:
```xml
  
    
      https://api.yanport.com
      xxx
    
  
```
And execute all tests (unit and integration ones):
```bash
dotnet test --settings Local.runsettings
```
## References
- [API Documentation](https://www.yanport.com/data/api/documentation)