Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/22/10 05:55:19 (14 years ago)
Author:
swagner
Message:

Worked on OKB (#1174)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Services.OKB/3.3/Convert.cs

    r4455 r4467  
    2020#endregion
    2121
     22using System.Data.Linq;
    2223using DA = HeuristicLab.Services.OKB.DataAccess;
    2324using DT = HeuristicLab.Services.OKB.DataTransfer;
     
    6061    }
    6162    #endregion
     63
     64    #region AlgorithmData
     65    public static DT.AlgorithmData ToDto(DA.AlgorithmData source) {
     66      return new DT.AlgorithmData { AlgorithmId = source.AlgorithmId, DataTypeId = source.DataTypeId, Data = source.Data.ToArray() };
     67    }
     68    public static DA.AlgorithmData ToEntity(DT.AlgorithmData source) {
     69      return new DA.AlgorithmData { AlgorithmId = source.AlgorithmId, DataTypeId = source.DataTypeId, Data = new Binary(source.Data) };
     70    }
     71    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);
     73    }
     74    #endregion
     75
     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 };
     79    }
     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 };
     82    }
     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;
     85    }
     86    #endregion
    6287  }
    6388}
Note: See TracChangeset for help on using the changeset viewer.