This repository has been archived on 2023-10-28. You can view files and clone it, but cannot push or open issues or pull requests.
pwt-0x01-ng/Models/Carousel.cs
surtur cf223daf81
All checks were successful
continuous-integration/drone/push Build is passing
chore: more carousel validation goodies
commit 81a5fe36c2aef355aa71a6208acea096dd35d70e
Author: surtur <a_mirre@utb.cz>
Date:   Mon Jan 25 22:29:48 2021 +0100

    chore: add client-side carousel edit validation

commit 5cddb4bd9b55a514d9aa6f79f291678c88d33773
Author: surtur <a_mirre@utb.cz>
Date:   Mon Jan 25 22:27:38 2021 +0100

    chore: add carousel image file type checking

    * since image is not required, so isn't ImageSrc
2021-01-25 22:32:34 +01:00

25 lines
663 B
C#

using Microsoft.AspNetCore.Http;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using pwt_0x01_ng.Models.Validation;
namespace pwt_0x01_ng.Models
{
[Table("Carousel")]
public class Carousel : Entity
{
[Required]
public string DataTarget { get; set; }
[NotMapped]
[FileTypeAttr("image")]
public IFormFile Image { get; set; }
[StringLength(255)]
public string ImageSrc { get; set; }
[Required]
[StringLength(50, ErrorMessage = "{0} length must be between {2} and {1}.", MinimumLength = 1)]
public string ImageAlt { get; set; }
[Required]
public string CarouselContent { get; set; }
}
}