[8958] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
[9215] | 5 | using HeuristicLab.Services.Optimization.ControllerService.Model;
|
---|
[8958] | 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 |
|
---|
[9215] | 20 | public interface IExperimentDao {
|
---|
| 21 | bool Add(string username, Experiment experiment);
|
---|
[9305] | 22 | bool Update(string username, Experiment experiment);
|
---|
[9215] | 23 | bool DeleteByName(string username, string experiment);
|
---|
[9324] | 24 | bool Delete(string username, string experimentId);
|
---|
[9215] | 25 | Experiment FindByName(string username, string experiment);
|
---|
[9324] | 26 | IEnumerable<Experiment> GetExperiments(string user, bool namesOnly = false);
|
---|
[9227] | 27 | Experiment GetExperimentByName(string username, string scenario);
|
---|
[9305] | 28 |
|
---|
| 29 | Experiment GetExperimentById(User user, string nodeId);
|
---|
[9215] | 30 | }
|
---|
| 31 |
|
---|
[8958] | 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 {
|
---|
[9215] | 39 | IScenarioDao ScenarioDao { get; }
|
---|
| 40 | IBlobDao BlobDao { get; }
|
---|
| 41 | IExperimentDao ExperimentDao { get; }
|
---|
[8958] | 42 | }
|
---|
[9166] | 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 | }
|
---|
[8958] | 52 | }
|
---|
| 53 |
|
---|