The following code shows how we will create a board, three chapter lists, and then add 10 chapters per list with due dates, all in just a few lines of code:
var expectedBoard = CreateBoard("Microservice Ecosystem", "Hands on Microservices with C#");
var expectedList = CreateList("Drafts");
for (int x=0; x<10; x++)
CreateCard("Chapter " + (x + 1).ToString(), RandomString(25), false,
x % 2 == 0
? SystemClock.Instance.GetCurrentInstant().ToDateTimeUtc().ToLocalTime().AddDays(12)
: DateTime.MinValue);
CreateList("Proofs");
for (int x = 0; x < 10; x++)
CreateCard("Chapter " + (x + 1).ToString(), RandomString(25), false,
x % 2 == 0
? SystemClock.Instance.GetCurrentInstant().ToDateTimeUtc().ToLocalTime().AddDays(24)
: DateTime.MinValue);
CreateList("Final Copies");
for (int x = 0; x < 10; x++)
CreateCard("Chapter " + (x + 1).ToString(), RandomString(25), false,
x % 2 == 0
? SystemClock.Instance.GetCurrentInstant().ToDateTimeUtc().ToLocalTime().AddDays(36)
: DateTime.MinValue);
After the previous calls, we will see that our newly created board, Microservice Ecosystem, has appeared on the board list. The command that did this was:
var expectedBoard = CreateBoard("Microservice Ecosystem", "Hands on Microservices with C#");
Once our board is created you can open Trello and see it displayed along with your other boards:
If we open our board, we can see that we have three lists that we created; Drafts, Proofs, and Final Copies. In each list, we have 10 chapters that we added. Every other chapter has a due date:
If you click on any of the chapters and open it up, you will see a detailed view similar to what you see in the following screenshot. In this example, you can see that we set an automatic Due Date of tomorrow at 5:03 AM (due soon):
Here is another view of our chapter card, showing how you could easily customize several more properties if you so desired:
With that done, we are going to close this chapter a bit differently. We are going to leave the remaining implementation of this microservice to you, the reader. Sort of a weird pop quiz, if you will. Just complete the TrelloRequestMessage, send the messages, subscribe to the messages, and process accordingly.