コード例 #1
0
 public PlatformItemDTO(Int64 id, Int64 itemId, Int64 detectedCount, Int64 detectedInModuleCount, DateTime lastDetectionTime, String logHistory, RouteDTO route, PlatformItemDTO itemBehind, PlatformItemDTO itemInFront, PlatformModuleEntityDTO associatedPlatformModuleEntity)
 {
     Id                             = id;
     ItemId                         = itemId;
     DetectedCount                  = detectedCount;
     DetectedInModuleCount          = detectedInModuleCount;
     LastDetectionTime              = lastDetectionTime;
     LogHistory                     = logHistory;
     Route                          = route;
     ItemBehind                     = itemBehind;
     ItemInFront                    = itemInFront;
     AssociatedPlatformModuleEntity = associatedPlatformModuleEntity;
 }
コード例 #2
0
        /// <summary>
        /// Converts this instance of <see cref="PlatformItem"/> to an instance of <see cref="PlatformItemDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="PlatformItem"/> to convert.</param>
        public static PlatformItemDTO ToDTO(this PlatformItem entity)
        {
            if (entity == null)
            {
                return(null);
            }

            PlatformItemDTO dto = new PlatformItemDTO();

            dto.Id                    = entity.Id;
            dto.ItemId                = entity.ItemId;
            dto.DetectedCount         = entity.DetectedCount;
            dto.DetectedInModuleCount = entity.DetectedInModuleCount;
            dto.LastDetectionTime     = entity.LastDetectionTime;
            dto.LogHistory            = entity.LogHistory;

            return(dto);
        }
コード例 #3
0
        /// <summary>
        /// Converts this instance of <see cref="PlatformItemDTO"/> to an instance of <see cref="PlatformItem"/>.
        /// </summary>
        /// <param name="dto"><see cref="PlatformItemDTO"/> to convert.</param>
        public static PlatformItem ToEntity(this PlatformItemDTO dto)
        {
            if (dto == null)
            {
                return(null);
            }

            PlatformItem entity = new PlatformItem();

            entity.Id                    = dto.Id;
            entity.ItemId                = dto.ItemId;
            entity.DetectedCount         = dto.DetectedCount;
            entity.DetectedInModuleCount = dto.DetectedInModuleCount;
            entity.LastDetectionTime     = dto.LastDetectionTime;
            entity.LogHistory            = dto.LogHistory;

            return(entity);
        }