1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using HeuristicLab.Services.Optimization.ControllerService.Model;
|
---|
6 |
|
---|
7 | namespace HeuristicLab.Services.Optimization.ControllerService.Interfaces {
|
---|
8 | public class StringEntry {
|
---|
9 | public string Key { get; set; }
|
---|
10 | public string Text { get; set; }
|
---|
11 | };
|
---|
12 |
|
---|
13 | public interface IScenarioDao {
|
---|
14 | bool Add(ScenarioEntity entity);
|
---|
15 | bool DeleteByName(string scenarioName);
|
---|
16 | ScenarioEntity FindByName(string scenarioName);
|
---|
17 | IEnumerable<ScenarioEntity> GetAllEntities();
|
---|
18 | }
|
---|
19 |
|
---|
20 | public interface IExperimentDao {
|
---|
21 | bool Add(string username, Experiment experiment);
|
---|
22 | bool DeleteByName(string username, string experiment);
|
---|
23 | Experiment FindByName(string username, string experiment);
|
---|
24 | IEnumerable<Experiment> GetExperiments(string user);
|
---|
25 | }
|
---|
26 |
|
---|
27 | public interface IBlobDao {
|
---|
28 | bool Add(StringEntry entry);
|
---|
29 | bool DeleteByKey(string entryKey);
|
---|
30 | StringEntry FindByKey(string entryKey);
|
---|
31 | }
|
---|
32 |
|
---|
33 | public interface IDataAccessLayer {
|
---|
34 | IScenarioDao ScenarioDao { get; }
|
---|
35 | IBlobDao BlobDao { get; }
|
---|
36 | IExperimentDao ExperimentDao { get; }
|
---|
37 | }
|
---|
38 |
|
---|
39 | public static class DataAccessLayerProvider {
|
---|
40 | private static IDataAccessLayer layer = new Azure.AzureDataAccessLayer();
|
---|
41 | //private static IDataAccessLayer layer = new Mockup.MockupDataAccessLayer();
|
---|
42 |
|
---|
43 | public static IDataAccessLayer GetLayer() {
|
---|
44 | return layer;
|
---|
45 | }
|
---|
46 | }
|
---|
47 | }
|
---|
48 |
|
---|