XDDDEEEE gtfo Merge branch 'master' of http://git.kadet.net/system-praktyk/system-praktyk-api into doroboty finaly Co-authored-by: MaxchilKH <m.w.bohdanowicz@gmail.com>
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using FluentValidation;
|
|
|
|
namespace InternshipSystem.Core
|
|
{
|
|
public class Mentor
|
|
{
|
|
public string FirstName { get; set; }
|
|
public string LastName { get; set; }
|
|
public string Email { get; set; }
|
|
public string PhoneNumber { get; set; }
|
|
|
|
public void UpdateInformation(string firstName, string lastName, string email, string phoneNumber)
|
|
{
|
|
FirstName = firstName ?? FirstName;
|
|
LastName = lastName ?? LastName;
|
|
Email = email ?? Email;
|
|
PhoneNumber = phoneNumber ?? PhoneNumber;
|
|
}
|
|
|
|
public class Validate : AbstractValidator<Mentor>
|
|
{
|
|
public Validate()
|
|
{
|
|
RuleFor(x => x.FirstName)
|
|
.NotEmpty();
|
|
RuleFor(x => x.LastName)
|
|
.NotEmpty();
|
|
RuleFor(x => x.Email)
|
|
.NotEmpty();
|
|
RuleFor(x => x.PhoneNumber)
|
|
.NotEmpty();
|
|
|
|
}
|
|
}
|
|
}
|
|
} |