Changeset 4481 for branches/OKB/HeuristicLab.Services.OKB/3.3/Convert.cs
- Timestamp:
- 09/24/10 06:53:43 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB/HeuristicLab.Services.OKB/3.3/Convert.cs
r4467 r4481 28 28 #region Platform 29 29 public static DT.Platform ToDto(DA.Platform source) { 30 if (source == null) return null; 30 31 return new DT.Platform { Id = source.Id, Name = source.Name, Description = source.Description }; 31 32 } 32 33 public static DA.Platform ToEntity(DT.Platform source) { 34 if (source == null) return null; 33 35 return new DA.Platform { Id = source.Id, Name = source.Name, Description = source.Description }; 34 36 } 35 37 public static void ToEntity(DT.Platform source, DA.Platform target) { 36 target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; 38 if ((source != null) && (target != null)) 39 target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; 40 } 41 #endregion 42 43 #region DataType 44 public static DT.DataType ToDto(DA.DataType source) { 45 if (source == null) return null; 46 return new DT.DataType { Id = source.Id, Name = source.Name, SqlName = source.SqlName, PlatformId = source.PlatformId }; 47 } 48 public static DA.DataType ToEntity(DT.DataType source) { 49 if (source == null) return null; 50 return new DA.DataType { Id = source.Id, Name = source.Name, SqlName = source.SqlName, PlatformId = source.PlatformId }; 51 } 52 public static void ToEntity(DT.DataType source, DA.DataType target) { 53 if ((source != null) && (target != null)) 54 target.Id = source.Id; target.Name = source.Name; target.SqlName = source.SqlName; target.PlatformId = source.PlatformId; 37 55 } 38 56 #endregion … … 40 58 #region AlgorithmClass 41 59 public static DT.AlgorithmClass ToDto(DA.AlgorithmClass source) { 60 if (source == null) return null; 42 61 return new DT.AlgorithmClass { Id = source.Id, Name = source.Name, Description = source.Description }; 43 62 } 44 63 public static DA.AlgorithmClass ToEntity(DT.AlgorithmClass source) { 64 if (source == null) return null; 45 65 return new DA.AlgorithmClass { Id = source.Id, Name = source.Name, Description = source.Description }; 46 66 } 47 67 public static void ToEntity(DT.AlgorithmClass source, DA.AlgorithmClass target) { 48 target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; 68 if ((source != null) && (target != null)) 69 target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; 49 70 } 50 71 #endregion … … 52 73 #region Algorithm 53 74 public static DT.Algorithm ToDto(DA.Algorithm source) { 75 if (source == null) return null; 54 76 return new DT.Algorithm { Id = source.Id, Name = source.Name, Description = source.Description, PlatformId = source.PlatformId, AlgorithmClassId = source.AlgorithmClassId }; 55 77 } 56 78 public static DA.Algorithm ToEntity(DT.Algorithm source) { 79 if (source == null) return null; 57 80 return new DA.Algorithm { Id = source.Id, Name = source.Name, Description = source.Description, PlatformId = source.PlatformId, AlgorithmClassId = source.AlgorithmClassId }; 58 81 } 59 82 public static void ToEntity(DT.Algorithm source, DA.Algorithm target) { 60 target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; target.PlatformId = source.PlatformId; target.AlgorithmClassId = source.AlgorithmClassId; 83 if ((source != null) && (target != null)) 84 target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; target.PlatformId = source.PlatformId; target.AlgorithmClassId = source.AlgorithmClassId; 61 85 } 62 86 #endregion … … 64 88 #region AlgorithmData 65 89 public static DT.AlgorithmData ToDto(DA.AlgorithmData source) { 90 if (source == null) return null; 66 91 return new DT.AlgorithmData { AlgorithmId = source.AlgorithmId, DataTypeId = source.DataTypeId, Data = source.Data.ToArray() }; 67 92 } 68 93 public static DA.AlgorithmData ToEntity(DT.AlgorithmData source) { 94 if (source == null) return null; 69 95 return new DA.AlgorithmData { AlgorithmId = source.AlgorithmId, DataTypeId = source.DataTypeId, Data = new Binary(source.Data) }; 70 96 } 71 97 public static void ToEntity(DT.AlgorithmData source, DA.AlgorithmData target) { 72 target.AlgorithmId = source.AlgorithmId; target.DataTypeId = source.DataTypeId; target.Data = new Binary(source.Data); 98 if ((source != null) && (target != null)) 99 target.AlgorithmId = source.AlgorithmId; target.DataTypeId = source.DataTypeId; target.Data = new Binary(source.Data); 73 100 } 74 101 #endregion 75 102 76 #region DataType 77 public static DT.DataType ToDto(DA.DataType source) { 78 return new DT.DataType { Id = source.Id, Name = source.Name, SqlName = source.SqlName, PlatformId = source.PlatformId }; 103 #region ProblemClass 104 public static DT.ProblemClass ToDto(DA.ProblemClass source) { 105 if (source == null) return null; 106 return new DT.ProblemClass { Id = source.Id, Name = source.Name, Description = source.Description }; 79 107 } 80 public static DA.DataType ToEntity(DT.DataType source) { 81 return new DA.DataType { Id = source.Id, Name = source.Name, SqlName = source.SqlName, PlatformId = source.PlatformId }; 108 public static DA.ProblemClass ToEntity(DT.ProblemClass source) { 109 if (source == null) return null; 110 return new DA.ProblemClass { Id = source.Id, Name = source.Name, Description = source.Description }; 82 111 } 83 public static void ToEntity(DT.DataType source, DA.DataType target) { 84 target.Id = source.Id; target.Name = source.Name; target.SqlName = source.SqlName; target.PlatformId = source.PlatformId; 112 public static void ToEntity(DT.ProblemClass source, DA.ProblemClass target) { 113 if ((source != null) && (target != null)) 114 target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; 115 } 116 #endregion 117 118 #region Algorithm 119 public static DT.Problem ToDto(DA.Problem source) { 120 if (source == null) return null; 121 return new DT.Problem { Id = source.Id, Name = source.Name, Description = source.Description, PlatformId = source.PlatformId, ProblemClassId = source.ProblemClassId }; 122 } 123 public static DA.Problem ToEntity(DT.Problem source) { 124 if (source == null) return null; 125 return new DA.Problem { Id = source.Id, Name = source.Name, Description = source.Description, PlatformId = source.PlatformId, ProblemClassId = source.ProblemClassId }; 126 } 127 public static void ToEntity(DT.Problem source, DA.Problem target) { 128 if ((source != null) && (target != null)) 129 target.Id = source.Id; target.Name = source.Name; target.Description = source.Description; target.PlatformId = source.PlatformId; target.ProblemClassId = source.ProblemClassId; 130 } 131 #endregion 132 133 #region ProblemData 134 public static DT.ProblemData ToDto(DA.ProblemData source) { 135 if (source == null) return null; 136 return new DT.ProblemData { ProblemId = source.ProblemId, DataTypeId = source.DataTypeId, Data = source.Data.ToArray() }; 137 } 138 public static DA.ProblemData ToEntity(DT.ProblemData source) { 139 if (source == null) return null; 140 return new DA.ProblemData { ProblemId = source.ProblemId, DataTypeId = source.DataTypeId, Data = new Binary(source.Data) }; 141 } 142 public static void ToEntity(DT.ProblemData source, DA.ProblemData target) { 143 if ((source != null) && (target != null)) 144 target.ProblemId = source.ProblemId; target.DataTypeId = source.DataTypeId; target.Data = new Binary(source.Data); 85 145 } 86 146 #endregion
Note: See TracChangeset
for help on using the changeset viewer.