DD.WellWorkover.Cloud/AsbCloudInfrastructure/Validators/WellDtoValidator.cs

16 lines
583 B
C#
Raw Normal View History

2022-01-12 17:28:27 +05:00
using AsbCloudApp.Data;
using FluentValidation;
namespace AsbCloudInfrastructure.Validators
{
public class WellDtoValidator : AbstractValidator<WellDto>
{
public WellDtoValidator()
{
RuleFor(x => x.Latitude).Must(lat => lat is <= 90 and >= -90)
.WithMessage("Допустимые значения широты от -90 до 90");
RuleFor(x => x.Longitude).Must(lat => lat is <= 180 and >= -180)
.WithMessage("Допустимые значения долготы от -180 до 180");
}
}
}