Esempio n. 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;
 }
Esempio n. 2
0
        /// <summary>
        /// Converts this instance of <see cref="Route"/> to an instance of <see cref="RouteDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="Route"/> to convert.</param>
        public static RouteDTO ToDTO(this Route entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new RouteDTO();

            dto.Id           = entity.Id;
            dto.CurrentIndex = entity.CurrentIndex;

            dto.RouteItems = entity.RouteItems.ToDTOs();

            return(dto);
        }
Esempio n. 3
0
        /// <summary>
        /// Converts this instance of <see cref="RouteDTO"/> to an instance of <see cref="Route"/>.
        /// </summary>
        /// <param name="dto"><see cref="RouteDTO"/> to convert.</param>
        public static Route ToEntity(this RouteDTO dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new Route();

            entity.Id           = dto.Id;
            entity.CurrentIndex = dto.CurrentIndex;

            entity.RouteItems = dto.RouteItems.ToEntities();

            return(entity);
        }