using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using newtelligence.DasBlog.Web.Core;
using newtelligence.DasBlog.Web;
using Microsoft.ServiceHosting.ServiceRuntime;
namespace newtelligence.DasBlog.Runtime.Azure{
public class SiteConfigDataServiceAzure : ISiteConfigDataService
{
private FileDataServiceAzure<SiteConfig> dataService = new FileDataServiceAzure<SiteConfig>();
public SiteConfigDataServiceAzure(string location)
{
//...
}
public SiteConfig GetSiteConfig()
{
var config = dataService.LoadFile("site.config", "config");
if (config == null)
{
config = new SiteConfig();
config.Root = RoleManager.GetConfigurationSetting("RootUrl");
Save(config);
}
return config;
}
public void Save(SiteConfig siteConfig)
{
dataService.SaveFile("site.config", "config", siteConfig);
}
}
}
|