GithubHelp home page GithubHelp logo

Comments (3)

Pinski avatar Pinski commented on July 17, 2024 1

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.

Pinski avatar Pinski commented on July 17, 2024

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.

iarri avatar iarri commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.