system-praktyk-api/src/InternshipSystem.Core/ValueObject/Mentor.cs
maxchil 8514e593fa doroboty (#53)
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>
2020-10-02 19:56:53 +02:00

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();
}
}
}
}