49 lines
1.2 KiB
C#

using Manager.Interfaces.DTO;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Manager.Interfaces.Models
{
/// <summary>
/// Section Information - Slider
/// </summary>
public class Slider : Section
{
[BsonElement("Images")]
public List<Image> Images { get; set; }
public SliderDTO ToDetailDTO()
{
return new SliderDTO()
{
/*Id = Id,
Label = Label,
Type = Type,
ImageId = ImageId,*/
Images = Images.Select(p => p.ToDTO()).ToList(),
};
}
}
public class Image
{
public List<TranslationDTO> Title { get; set; }
public List<TranslationDTO> Description { get; set; }
public string Source { get; set; } // url to resource id (local) or on internet
public ImageDTO ToDTO()
{
return new ImageDTO()
{
Title = Title,
Description = Description,
Source = Source
};
}
}
}