Ddp.NET is a library for connecting your .NET applications to a Meteor server.
The documentation assumes you are already familiar with Meteor; if you are not familiar, refer to the Meteor Documentation.
Ddp.NET works on the following platforms:
- .NET 4.5
- Windows 8.1
- Windows Phone 8.1
- All major DDP features are supported: connect to a server, login, create a collection, subscribe to data, modify collections, call server methods, and more
- Collections are strongly typed
- Collections events are handled automatically in the background; Ddp.NET will keep all the collections up to date with the latest events from the server
- Easy integration with WPF/XAML- Ddp.NET collections are ObservableCollections, meaning the UI can easily react to changes, and provides easy integration into existing frameworks
Easiest method to get started is to use nuget:
Install-Package DdpNet Here are a couple of quick examples of how to perform common Ddp.NET operations:
MeteorClient client = new MeteorClient(new Uri("ws://localhost:3000/websocket")); await client.ConnectAsync(); DdpCollection<Post> posts = client.GetCollection<Post>("posts"); await client.Subscribe("posts"); await client.Call("someMethodName"); await client.LoginPassword("userName", "password"); // Add a new item Post post = new Post("Github", "http://github.com"); string id = await posts.AddAsync(post); // Update the item with a dictionary of fields var fieldsToUpdate = new Dictionary<string, object>(){{"Title", "Github Homepage" } }; await posts.UpdateAsync(id, fieldsToUpdate); // Or update with another object Post updatedPost = new Post("Github2", "http://github.com"); await posts.UpdateAsync(id, updatedPost); // Remove the item await posts.RemoveAsync(id); Head to the Wiki for more information on using Ddp.NET.
The source code also includes a couple of sample applications using Ddp.NET. One is a WPF application that connects to the Meteor Leaderboard example. The other is a Windows 8.1 application that connects to a Microscope application (the application built in The Meteor Book).
Building Ddp.NET will require Visual Studio 2013 and >= .NET 4.5.