Index: branches/OaaS/HeuristicLab.Services.Optimization.Controller/Azure/DAL.cs
===================================================================
--- branches/OaaS/HeuristicLab.Services.Optimization.Controller/Azure/DAL.cs	(revision 9166)
+++ branches/OaaS/HeuristicLab.Services.Optimization.Controller/Azure/DAL.cs	(revision 9215)
@@ -8,4 +8,5 @@
 using Microsoft.WindowsAzure.ServiceRuntime;
 using System.Diagnostics;
+using HeuristicLab.Services.Optimization.ControllerService.Model;
 
 namespace HeuristicLab.Services.Optimization.ControllerService.Azure {
@@ -13,4 +14,5 @@
     public static readonly string SCENARIO_TABLE = "Scenario";
     public static readonly string SCENARIO_BLOB_CONTAINER = "scenario";
+    public static readonly string EXPERIMENT_TABLE = "Experiment";
     public static readonly string CLOUD_SETTINGS_KEY = "Cloudia.WindowsAzure.Storage";
   }
@@ -91,7 +93,96 @@
   }
 
+  internal sealed class ExperimentEntity : TableServiceEntity {
+    public ExperimentEntity() {
+    }
+
+    public ExperimentEntity(string user, Experiment experiment) {
+      PartitionKey = "ScenarioPartition";
+      RowKey = user + "_" + experiment.Name;
+      var scenarios = "";
+      foreach (var scen in experiment.Scenarios) {
+        scenarios += scen.Id + ",";
+      }
+      Scenarios = scenarios.Remove(scenarios.Length - 1);
+      User = user;
+    }
+
+    public string User { get; set; }
+
+    public string Scenarios { get; set; }
+
+  }
+
+  public class ExperimentDao : IExperimentDao {
+    public CloudBlobClient BlobClient { get; set; }
+    public CloudTableClient TableClient { get; set; }
+
+    public bool Add(string username, Model.Experiment experiment) {
+      if (FindByName(username, experiment.Name) != null)
+        return false;
+
+      TableServiceContext serviceContext = TableClient.GetDataServiceContext();
+      TableClient.CreateTableIfNotExist(AzureConstants.EXPERIMENT_TABLE);
+      var entity = new ExperimentEntity(username, experiment);
+      serviceContext.AddObject(AzureConstants.EXPERIMENT_TABLE, entity);
+      serviceContext.SaveChangesWithRetries();
+      return true;
+    }
+
+    public bool DeleteByName(string username, string experiment) {
+      TableServiceContext serviceContext = TableClient.GetDataServiceContext();
+      TableClient.CreateTableIfNotExist(AzureConstants.EXPERIMENT_TABLE);
+      var entity = (from e in serviceContext.CreateQuery<ExperimentEntity>(AzureConstants.EXPERIMENT_TABLE)
+                    where e.RowKey == (username + "_" + experiment)
+                    select e).FirstOrDefault();
+      
+      if (entity == null)
+        return false;
+
+      serviceContext.DeleteObject(entity);
+      serviceContext.SaveChangesWithRetries();
+      return true;
+    }
+
+    public Model.Experiment FindByName(string username, string experiment) {
+      TableServiceContext serviceContext = TableClient.GetDataServiceContext();
+      TableClient.CreateTableIfNotExist(AzureConstants.EXPERIMENT_TABLE);
+      var entity = (from e in serviceContext.CreateQuery<ExperimentEntity>(AzureConstants.EXPERIMENT_TABLE)
+                    where e.RowKey == (username + "_" + experiment)
+                    select e).FirstOrDefault();
+      
+      if (entity == null) {
+        return null;
+      }
+
+      var exp = Convert(entity);
+      return exp;
+    }
+
+    private Experiment Convert(ExperimentEntity entity) {
+      var exp = new Experiment() { Name = entity.RowKey.Split('_')[1] };
+      foreach (var scenarioName in entity.Scenarios.Split(','))
+        exp.Scenarios.Add(new OptimizationScenario() { Id = scenarioName });
+      return exp;
+    }
+
+    public IEnumerable<Model.Experiment> GetExperiments(string user) {
+      TableServiceContext serviceContext = TableClient.GetDataServiceContext();
+      TableClient.CreateTableIfNotExist(AzureConstants.EXPERIMENT_TABLE);
+      var entites = (from e in serviceContext.CreateQuery<ExperimentEntity>(AzureConstants.EXPERIMENT_TABLE)
+                    where e.User == user
+                    select e).ToList();
+      var experiments = new List<Experiment>();
+      foreach (var entity in entites) {
+        experiments.Add(Convert(entity));
+      }
+      return experiments;
+    }
+  }
+
   public class AzureDataAccessLayer : IDataAccessLayer {
     private IScenarioDao scenarioDao;
     private IBlobDao blobDao;
+    private IExperimentDao expDao;
 
     private CloudStorageAccount storageAccount;
@@ -115,5 +206,5 @@
       get {
         if (scenarioDao == null) {
-          scenarioDao = new ScenarioDao();
+          scenarioDao = new ScenarioDao() { TableClient = StorageAccount.CreateCloudTableClient() };
         }
         return scenarioDao;
@@ -124,5 +215,5 @@
       get {
         if (blobDao == null) {
-          blobDao = new BlobDao();
+          blobDao = new BlobDao() { BlobClient = StorageAccount.CreateCloudBlobClient() };
         }
         return blobDao;
@@ -130,10 +221,11 @@
     }
 
-    public IScenarioDao CreateScenarioDao() {
-      return new ScenarioDao() { TableClient = StorageAccount.CreateCloudTableClient() };
-    }
-
-    public IBlobDao CreateBlobDao() {
-      return new BlobDao() { BlobClient = StorageAccount.CreateCloudBlobClient() };
+    public IExperimentDao ExperimentDao {
+      get {
+        if (expDao == null) {
+          expDao = new ExperimentDao() { TableClient = StorageAccount.CreateCloudTableClient() };
+        }
+        return expDao;
+      }
     }
   }
