using Manager.DTOs;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using static ManagerService.Data.SectionText;
namespace ManagerService.Data.SubSection
{
///
/// Section web
///
public class SectionWeb : Section
{
[Required]
public string WebSource { get; set; } // url to resource id (local) or on internet
// WebSource pointe vers une page externe : son contenu n'est ni stocké ni téléchargeable.
public override string GetEmbeddableText(string language) => BaseText(language);
public override IEnumerable GetReferencedResourceIds(string language = null) => BaseResourceIds();
public WebDTO ToDTO()
{
return new WebDTO()
{
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,
source = WebSource
};
}
}
}