1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using DA = HeuristicLab.Services.OKB.DataAccess;
|
---|
23 | using DT = HeuristicLab.Services.OKB.DataTransfer;
|
---|
24 |
|
---|
25 | namespace HeuristicLab.Services.OKB {
|
---|
26 | public static class Convert {
|
---|
27 | #region Platform
|
---|
28 | public static DT.Platform ToDto(DA.Platform source) {
|
---|
29 | return new DT.Platform { Id = source.Id, Name = source.Name, Description = source.Description };
|
---|
30 | }
|
---|
31 | public static DA.Platform ToEntity(DT.Platform source) {
|
---|
32 | return new DA.Platform { Id = source.Id, Name = source.Name, Description = source.Description };
|
---|
33 | }
|
---|
34 | public static void ToEntity(DT.Platform source, DA.Platform target) {
|
---|
35 | target.Id = source.Id; target.Name = source.Name; target.Description = source.Description;
|
---|
36 | }
|
---|
37 | #endregion
|
---|
38 |
|
---|
39 | #region AlgorithmClass
|
---|
40 | public static DT.AlgorithmClass ToDto(DA.AlgorithmClass source) {
|
---|
41 | return new DT.AlgorithmClass { Id = source.Id, Name = source.Name, Description = source.Description };
|
---|
42 | }
|
---|
43 | public static DA.AlgorithmClass ToEntity(DT.AlgorithmClass source) {
|
---|
44 | return new DA.AlgorithmClass { Id = source.Id, Name = source.Name, Description = source.Description };
|
---|
45 | }
|
---|
46 | public static void ToEntity(DT.AlgorithmClass source, DA.AlgorithmClass target) {
|
---|
47 | target.Id = source.Id; target.Name = source.Name; target.Description = source.Description;
|
---|
48 | }
|
---|
49 | #endregion
|
---|
50 |
|
---|
51 | #region Algorithm
|
---|
52 | public static DT.Algorithm ToDto(DA.Algorithm source) {
|
---|
53 | return new DT.Algorithm { Id = source.Id, Name = source.Name, Description = source.Description, PlatformId = source.PlatformId, AlgorithmClassId = source.AlgorithmClassId };
|
---|
54 | }
|
---|
55 | public static DA.Algorithm ToEntity(DT.Algorithm source) {
|
---|
56 | return new DA.Algorithm { Id = source.Id, Name = source.Name, Description = source.Description, PlatformId = source.PlatformId, AlgorithmClassId = source.AlgorithmClassId };
|
---|
57 | }
|
---|
58 | public static void ToEntity(DT.Algorithm source, DA.Algorithm target) {
|
---|
59 | target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; target.PlatformId = source.PlatformId; target.AlgorithmClassId = source.AlgorithmClassId;
|
---|
60 | }
|
---|
61 | #endregion
|
---|
62 | }
|
---|
63 | }
|
---|