using System; using System.ComponentModel.DataAnnotations; namespace EnVisage.Models { public class UserQuickLinkModel : IBaseModel { public Guid Id { get; set; } [Required] [Display(Name = "Title")] [StringLength(250, ErrorMessage = "Name should not exceed 250 characters")] [RegularExpression(@"^[^<>]+$", ErrorMessage = "Text contains invalid characters")] public string Name { get; set; } public Guid UserId { get; set; } public string Url { get; set; } public string PageState { get; set; } /// /// Copies data from model to DAL object. /// /// A target DAL object. public void CopyTo(UserQuickLink dbObj) { if (dbObj == null) throw new ArgumentNullException(); dbObj.Id = Id; dbObj.Name = Name; dbObj.UserId = UserId; dbObj.Url = Url; dbObj.PageState = PageState; } } }