/// <summary> /// 将EditModel转换为广告位实体 /// </summary> /// <returns></returns> public AdvertisingPosition AsAdvertisingPosition() { AdvertisingService advertisingService = new AdvertisingService(); AdvertisingPosition position = advertisingService.GetPosition(PositionId); if (position == null) { position = AdvertisingPosition.New(); position.PositionId = PositionId; } position.Description = Description ?? string.Empty; position.FeaturedImage = FeaturedImage ?? string.Empty; position.PresentAreaKey = PresentAreaKey; position.Height = Height; position.Width = Width; position.IsEnable = IsEnable; return(position); }