Comments (3)
This is a standard thing in .NET.
Your variable results is of type Yelp.Api.Models.SearchResponse. Console.WriteLine expects a string. SearchResponse has no .ToString function on it. So when you take a type and cast it to a string, it just outputs the type name.
You'll need to actually output the data in some type of format that you wish. For example:
Console.WriteLine(results.Total);
Or you could iterate over the public IList<BusinessResponse> Businesses { get; set; }
Again, my project has an entire working example project that demonstrates how to retrieve and display objects in this library.
https://github.com/Pinski/Yelp.Api.Web
from yelp.api.
This NuGet package doesn't target .NET Core so it won't work with a .NET Core project (which is what that warning means). I've forked this project and added support for .NET Core along with some other features.
https://github.com/Pinski/Yelp.Api.Web
Currently I've only tested it with .NET Core 1.x but it might work with .NET Core 2.x. I'm in the process of putting in some missing APIs this month, cleaning up some code, and then I'm going to test it with more versions of .NET Core and maybe .NET Framework.
Feel free to check it out and let me know if you have any issues.
from yelp.api.
This NuGet package doesn't target .NET Core so it won't work with a .NET Core project (which is what that warning means). I've forked this project and added support for .NET Core along with some other features.
https://github.com/Pinski/Yelp.Api.Web
Currently I've only tested it with .NET Core 1.x but it might work with .NET Core 2.x. I'm in the process of putting in some missing APIs this month, cleaning up some code, and then I'm going to test it with more versions of .NET Core and maybe .NET Framework.
Feel free to check it out and let me know if you have any issues.
Thank you for your response!
I finally understand that it wont work on .NET core. I have worked on this more. It runs now, however the console outputs the following one line. What is my code missing?:
Yelp.Api.Models.SearchResponse
Here is my complete code:
using System;
using System.Threading.Tasks;
using Yelp.Api;
namespace yelp_example_test3
{
class Program
{
static void Main(string[] args)
{
YelpAPICommands().Wait();
Console.ReadKey();
}
static async Task YelpAPICommands()
{
var client = new Client("API KEY HERE");
var results = await client.SearchBusinessesAllAsync("cupcakes", 37.786882, -122.399972);
Console.WriteLine(results);
}
}
}
The good news is that I see the "remaining API calls" counter on my Yelp API account decrease every time I hit Debug. So I'm getting closer to getting the correct output!
from yelp.api.
Related Issues (9)
- Not compatible with netcoreapp1.1 HOT 2
- Would you mind if I maintained a Web version of this? HOT 2
- "Error converting value {null} to type 'System.Double'. Path 'coordinates.latitude' HOT 2
- Yelp Authentication Update HOT 13
- Upgrading json.net to 11.0.2 HOT 1
- How exactly do I run the code/project?
- 37,786882' is not of type 'number
- Can't search business by phone number
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yelp.api.