Giter Site home page Giter Site logo

Comments (4)

dillenmeister avatar dillenmeister commented on August 22, 2024

Sorry for the late answer. No, it's not possible.

If you have any ideas on how this could be designed I'm definately willing to listen.

from trello.net.

dillenmeister avatar dillenmeister commented on August 22, 2024

I just pushed a new feature: Trello.Advanced.

It has four methods, Get, Post, Put and Delete. They all accept a uri and an object with additional arguments. The return type is either dynamic or a type of your choosing.

This is how you could make that request:

dynamic myList = trello.Advanced.Get("/lists/1234567890abcdefghijklmn", 
    new { cards = "all" });

Console.WriteLine(myList.name);

foreach (var card in myList.cards)
    Console.WriteLine(card.name);

You can also create your own type if you don't want to deal with dynamic:

public class MyList
{
    public string Name { get; set; }
    public IEnumerable<MyCard> Cards { get; set; }
}

public class MyCard
{
    public string Name { get; set; }
}

MyList myList = trello.Advanced.Get<MyList>("/lists/1234567890abcdefghijklmn", 
    new { cards = "all" });

Console.WriteLine(myList.Name);

foreach (var card in myList.Cards)
    Console.WriteLine(card.Name);

The trello api is documented here: https://trello.com/docs/index.html.

from trello.net.

pauldbentley avatar pauldbentley commented on August 22, 2024

Excellent, this is just what I needed. I really like the way you have implemented this. Good work!

From: Oskar Dillén [mailto:[email protected]]
Sent: 01 May 2014 15:33
To: dillenmeister/Trello.NET
Cc: pauldbentley
Subject: Re: [Trello.NET] Passing optional parameters (#50)

I just pushed a new feature: Trello.Advanced.

It has four methods, Get, Post, Put and Delete. They all accept a uri and an object with additional arguments. The return type is either dynamic or a type of your choosing.

This is how you could make that request:

dynamic myList = trello.Advanced.Get("/lists/1234567890abcdefghijklmn",
new { cards = "all" });

Console.WriteLine(myList.name);

foreach (var card in myList.cards)
Console.WriteLine(card.name);

You can also create your own type if you don't want to deal with dynamic:

public class MyList
{
public string Name { get; set; }
public IEnumerable Cards { get; set; }
}

public class MyCard
{
public string Name { get; set; }
}

MyList myList = trello.Advanced.Get("/lists/1234567890abcdefghijklmn",
new { cards = "all" });

Console.WriteLine(myList.Name);

foreach (var card in myList.Cards)
Console.WriteLine(card.Name);

The trello api is documented here: https://trello.com/docs/index.html.


Reply to this email directly or view it on GitHub #50 (comment) . https://github.com/notifications/beacon/5243982__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxNDU3Mzk1MiwiZGF0YSI6eyJpZCI6MjM2MDcxODB9fQ==--df6092f041ab19f8b56d336a1d9ba7ab43fdc9dd.gif

from trello.net.

dillenmeister avatar dillenmeister commented on August 22, 2024

Great! Let me know if you have any issues with it.

from trello.net.

Related Issues (20)

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.