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 Update(string username, Experiment experiment);
|
---|
23 | bool DeleteByName(string username, string experiment);
|
---|
24 | bool Delete(string username, string experimentId);
|
---|
25 | Experiment FindByName(string username, string experiment);
|
---|
26 | IEnumerable<Experiment> GetExperiments(string user, bool namesOnly = false);
|
---|
27 | Experiment GetExperimentByName(string username, string scenario);
|
---|
28 |
|
---|
29 | Experiment GetExperimentById(User user, string nodeId);
|
---|
30 | }
|
---|
31 |
|
---|
32 | public interface IBlobDao {
|
---|
33 | bool Add(StringEntry entry);
|
---|
34 | bool DeleteByKey(string entryKey);
|
---|
35 | StringEntry FindByKey(string entryKey);
|
---|
36 | }
|
---|
37 |
|
---|
38 | public interface IDataAccessLayer {
|
---|
39 | IScenarioDao ScenarioDao { get; }
|
---|
40 | IBlobDao BlobDao { get; }
|
---|
41 | IExperimentDao ExperimentDao { get; }
|
---|
42 | }
|
---|
43 |
|
---|
44 | public static class DataAccessLayerProvider {
|
---|
45 | private static IDataAccessLayer layer = new Azure.AzureDataAccessLayer();
|
---|
46 | //private static IDataAccessLayer layer = new Mockup.MockupDataAccessLayer();
|
---|
47 |
|
---|
48 | public static IDataAccessLayer GetLayer() {
|
---|
49 | return layer;
|
---|
50 | }
|
---|
51 | }
|
---|
52 | }
|
---|
53 |
|
---|