Giter VIP home page Giter VIP logo

csharpmtgdb.info's People

Contributors

jpann avatar ontehfritz avatar rezalas avatar thezappa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

csharpmtgdb.info's Issues

Get methods always return null because string format parameter data type is included in the url

Whenever I call GetCard (or any other Get method) using the latest source, it always returns null whenever I pass an id parameter.

Code:

var db = new Db();
Card card = db.GetCard(1);

Debugging shows that it is actually actually using the url 'https://api.mtgdb.info/cards/System.String[]' and silently handles this exception.

Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'MtgDb.Info.Card' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path '', line 1, position 1.

JsonSerializationException was unhandled

The following code:

private void button1_Click(object sender, EventArgs e)
{
            var Db = new MtgDb.Info.Driver.Db();
            Card card = Db.GetRandomCard(); <-- Throwed here
            pictureBox1.Load(card.CardImage);
}

Throws unhandled exception randomly.
Exception:
An unhandled exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in Newtonsoft.Json.dll
Additional information: Error converting value {null} to type 'System.DateTime'. Path 'releasedAt', line 1, position 1890.

The API returns empty release dates and the parser can't handle them, am I right?

Also:
< packages>
< package id="MtgDb.Info.Driver" version="0.3" targetFramework="net40" />
< package id="Newtonsoft.Json" version="6.0.2" targetFramework="net40" />
< /packages>

Get cards from set by range logic

Probably should have a check like this:

if( end < start || start <= 0 )

rather than

if( start > 0 || end > 0 )

to ensure success of the API call.

Compiled Driver in mono doesn't work on Windows

Side Note: Projects in monodevelop don't seem to be able to load with VS 2010, however vice versa is OK.

Also the C# driver throws exceptions on windows 7:

System.IO.FileNotFoundException: Could not load file or assembly 'MtgDb.Info.Driver, Version=0.1.5176.17133, Culture=en, PublicKeyToken=null' or one of its dependencies. Het systeem kan het opgegeven bestand niet vinden.
File name: 'MtgDb.Info.Driver, Version=0.1.5176.17133, Culture=en, PublicKeyToken=null'

Kudos to: Gilles Van Glabeke

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.