Exemplos de integração .NET

 

Versão Atual 
DoohNow SDK

 

C#

string TokenId = "8D26EB8E....99B9F0FB64";

#region "Datastore"

DoohNow.SDK.Datastore DataStore = new DoohNow.SDK.Datastore(TokenId);

//Sending a content through arguments
DataStore.SetContent("my_datastore_name_1", "my_value_1", Now);

//Sending a content through an object
DoohNow.SDK.Datastore.Content ContentItem = new DoohNow.SDK.Datastore.Content();
ContentItem.Name = "my_datastore_name_2";
ContentItem.Value = "my_value_2";
ContentItem.UpdateDate = Now;
DataStore.SetContent(ContentItem);

//Sending a content list through an list
List<DoohNow.SDK.Datastore.Content> ContentList = new List<DoohNow.SDK.Datastore.Content>();

for (int i = 0; i <= 10; i++) {

    DoohNow.SDK.Datastore.Content Content = new DoohNow.SDK.Datastore.Content();
    Content.Name = "my_list_datastore_name_" + i;
    Content.Value = "my_list_value_" + i;
    Content.UpdateDate = Now;
    ContentList.Add(Content);

}
DataStore.SetContent(ContentList);

//Collecting a content through name
DoohNow.SDK.Datastore.Content ContentFromDatastore = default(DoohNow.SDK.Datastore.Content);
ContentFromDatastore = DataStore.GetContent("my_datastore_name_1");

#endregion

#region "TV"

DoohNow.SDK.Tv TV = new DoohNow.SDK.Tv(TokenId);

//Syncing TV for update Datastore for him
TV.SetSync();

#endregion

#region "People"

DoohNow.SDK.People People = new DoohNow.SDK.People(TokenId);

//Collecting a people list
List<DoohNow.SDK.People.Person> ListOfPeople = default(List<DoohNow.SDK.People.Person>);

ListOfPeople = People.GetContent();

#endregion

 

 

VBNET

Dim TokenId As String = "8D26EB8E....99B9F0FB64"

#Region "Datastore"

Dim DataStore As New DoohNow.SDK.Datastore(TokenId)

'Sending a content through arguments
DataStore.SetContent("my_datastore_name_1", "my_value_1", Now)

'Sending a content through an object
Dim ContentItem As New DoohNow.SDK.Datastore.Content
ContentItem.Name = "my_datastore_name_2"
ContentItem.Value = "my_value_2"
ContentItem.UpdateDate = Now
DataStore.SetContent(ContentItem)

'Sending a content list through an list
Dim ContentList As New List(Of DoohNow.SDK.Datastore.Content)
For i As Integer = 0 To 10

    Dim Content As New DoohNow.SDK.Datastore.Content
    Content.Name = "my_list_datastore_name_" & i
    Content.Value = "my_list_value_" & i
    Content.UpdateDate = Now
    ContentList.Add(Content)

Next
DataStore.SetContent(ContentList)

'Collecting a content through name
Dim ContentFromDatastore As DoohNow.SDK.Datastore.Content
ContentFromDatastore = DataStore.GetContent("my_datastore_name_1")

#End Region

#Region "TV"

Dim TV As New DoohNow.SDK.Tv(TokenId)

'Syncing TV for update Datastore for him
TV.SetSync()

#End Region

#Region "People"

Dim People As New DoohNow.SDK.People(TokenId)

'Collecting a people list
Dim ListOfPeople As List(Of DoohNow.SDK.People.Person)
ListOfPeople = People.GetContent()

#End Region

 

Tem mais dúvidas? Envie uma solicitação

0 Comentários

Por favor, entre para comentar.