using DomainObjects;
using DomainObjects.PageSections;
using WeatherForecast.Models.Abstractions;
namespace WeatherForecast.Models.Content.Responses.PageSections {
///
///
///
public class ReviewerModel {
///
///
///
public Guid Id { get; set; }
///
///
///
public MediaAttachmentResponseModel? Image { get; set; }
///
///
///
public string FullName { get; set; }
///
///
///
public string Position { get; set; }
///
///
///
///
public ReviewerModel(Reviewer reviewer) {
FullName = reviewer.FullName;
Position = reviewer.Position;
if (reviewer.Image != null)
Image = new MediaAttachmentResponseModel(reviewer.Image);
}
}
///
///
///
public class TestimonialModel {
///
///
///
public string Text { get; set; }
///
///
///
public ReviewerModel Reviewer { get; set; }
///
///
///
///
public TestimonialModel(Testimonial testimonial) {
Text = testimonial.Text;
Reviewer = new ReviewerModel(testimonial.Reviewer);
}
}
///
///
///
public class TestimonialsSectionModel : PageSectionModelBase {
///
///
///
public List Items { get; set; }
///
///
///
///
public TestimonialsSectionModel(TestimonialsSection testimonialsSection) : base(testimonialsSection) {
Items = testimonialsSection.Items.Select(x => new TestimonialModel(x)).ToList();
}
}
}