using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Samples.ServiceHosting.StorageClient;
namespace newtelligence.DasBlog.Runtime.Azure{
public class EventDataServiceContext : TableStorageDataServiceContext
{
public EventDataServiceContext(StorageAccountInfo accountInfo)
: base(accountInfo)
{
// ...
}
public IQueryable<EventDataEntity> Events
{
get
{
return this.CreateQuery<EventDataEntity>("Events");
}
}
public void AddEventData(EventDataEntity eventData)
{
if (eventData == null) { throw new ArgumentNullException("eventData"); }
this.AddObject("Events", eventData);
this.SaveChanges();
}
}
}
|