Exemple #1
0
        public static DB.UserStatistics ToEntity(DT.UserStatistics source)
        {
            if (source == null)
            {
                return(null);
            }
            var entity = new DB.UserStatistics(); ToEntity(source, entity);

            return(entity);
        }
Exemple #2
0
 public static void ToEntity(DT.UserStatistics source, DB.UserStatistics target)
 {
     if ((source != null) && (target != null))
     {
         target.StatisticsId                = source.Id;
         target.UserId                      = source.UserId;
         target.UsedCores                   = source.UsedCores;
         target.ExecutionTimeMs             = source.ExecutionTime.TotalMilliseconds;
         target.ExecutionTimeMsFinishedJobs = source.ExecutionTimeFinishedJobs.TotalMilliseconds;
         target.StartToEndTimeMs            = source.StartToEndTime.TotalMilliseconds;
     }
 }
Exemple #3
0
 public static DT.UserStatistics ToDto(DB.UserStatistics source)
 {
     if (source == null)
     {
         return(null);
     }
     return(new DT.UserStatistics {
         Id = source.StatisticsId,
         UserId = source.UserId,
         UsedCores = source.UsedCores,
         ExecutionTime = TimeSpan.FromMilliseconds(source.ExecutionTimeMs),
         ExecutionTimeFinishedJobs = TimeSpan.FromMilliseconds(source.ExecutionTimeMsFinishedJobs),
         StartToEndTime = TimeSpan.FromMilliseconds(source.StartToEndTimeMs)
     });
 }
Exemple #4
0
 public static DB.UserStatistics ToEntity(DT.UserStatistics source) {
   if (source == null) return null;
   var entity = new DB.UserStatistics(); ToEntity(source, entity);
   return entity;
 }