tehnomarket/TechMarket/Models/ContactViewModel.cs

21 lines
918 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.ComponentModel.DataAnnotations;
namespace TechMarket.Models;
public class ContactViewModel
{
[Required(ErrorMessage = "Представьтесь, пожалуйста")]
[StringLength(100, ErrorMessage = "Имя слишком длинное")]
[Display(Name = "Ваше имя")]
public string Name { get; set; } = string.Empty;
[Required(ErrorMessage = "Укажите электронную почту")]
[EmailAddress(ErrorMessage = "Похоже, e-mail написан с ошибкой")]
[Display(Name = "E-mail")]
public string Email { get; set; } = string.Empty;
[Required(ErrorMessage = "Напишите сообщение")]
[StringLength(1000, ErrorMessage = "Сообщение слишком длинное (лимит 1000 символов)")]
[Display(Name = "Сообщение")]
public string Message { get; set; } = string.Empty;
}