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