| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using FluentValidation;
- using GreenTree.Strohrmann.ERP.Domain.Model;
- using GreenTree.Strohrmann.ERP.Web.Models.Business;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- namespace GreenTree.Strohrmann.ERP.Web.Validators
- {
- public class EmployeeValidator : AbstractValidator<EmployeeModel>
- {
- #region DI fields
- // The global DbContext
- private readonly ERPDbContext _eRPDbContext;
- #endregion
- #region Ctor
- /// <summary>
- /// Initializes a new instance of the EmployeeValidator class
- /// </summary>
- /// <param name="eRPDbContext">Global DbContext.</param>
- public EmployeeValidator(
- ERPDbContext eRPDbContext)
- {
- _eRPDbContext = eRPDbContext;
- RuleFor(m => m.Firstname)
- .NotEmpty();
- RuleFor(m => m.Lastname)
- .NotEmpty();
- RuleFor(m => m.EmployeeDegree)
- .NotEmpty();
- }
- #endregion
- }
- }
|