using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Samples.ServiceHosting.StorageClient;
namespace newtelligence.DasBlog.Runtime.Azure{
public class SiteSecurityDataServiceContext : TableStorageDataServiceContext
{
public SiteSecurityDataServiceContext(StorageAccountInfo accountInfo)
: base(accountInfo)
{
// ...
}
public IQueryable<UserEntity> Users
{
get
{
return this.CreateQuery<UserEntity>("Users");
}
}
public void AddUser(UserEntity userData)
{
if (userData == null) { throw new ArgumentNullException("userData"); }
this.AddObject("Users", userData);
this.SaveChanges();
}
public void UpdateUser(UserEntity userData)
{
if (userData == null) { throw new ArgumentNullException("userData"); }
this.UpdateObject(userData);
this.SaveChanges();
}
public void DeleteUser(UserEntity userData)
{
if (userData == null) { throw new ArgumentNullException("userData"); }
this.DeleteObject(userData);
this.SaveChanges();
}
}
}
|