2026-07-08 17:00:43 +02:00

49 lines
1.5 KiB
C#

using Manager.DTOs;
using ManagerService.DTOs;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
namespace ManagerService.Data.SubSection
{
public class SectionParcours : Section
{
public bool ShowMap { get; set; } = true;
public string? BaseSectionMapId { get; set; }
[ForeignKey(nameof(BaseSectionMapId))]
public SectionMap? BaseMap { get; set; }
public List<GuidedPath> GuidedPaths { get; set; } = new();
public ParcoursDTO ToDTO()
{
return new ParcoursDTO
{
id = Id,
label = Label,
title = Title.ToList(),
description = Description.ToList(),
order = Order,
type = Type,
imageId = ImageId,
imageSource = ImageSource,
configurationId = ConfigurationId,
isSubSection = IsSubSection,
parentId = ParentId,
dateCreation = DateCreation,
instanceId = InstanceId,
isBeacon = IsBeacon,
beaconId = BeaconId,
latitude = Latitude,
longitude = Longitude,
meterZoneGPS = MeterZoneGPS,
showMap = ShowMap,
baseSectionMapId = BaseSectionMapId,
guidedPaths = GuidedPaths?.Select(gp => gp.ToDTO()).ToList()
};
}
}
}