コード例 #1
0
        public void Init()
        {
            conection  = new MSSQLDB(new DBConfiguration());
            _PREP      = new ProfessorRepository(conection);
            _encryptor = new Encryptor();
            handler    = new ProfessorCommandHandler(_PREP, _encryptor);

            var db = conection.GetCon();

            var    cpf      = "357.034.413-40";
            string password = cpf.Replace("-", "").Replace(".", "");

            password = _encryptor.Encrypt(password, out string salt);

            professor = new Professor("Lívia", "Emanuelly Elisa", cpf, "*****@*****.**", "(21) 2682-8370", EDegree.Master, password, salt);
            _PREP.Create(professor);

            commandRegister = new ProfessorInputRegister()
            {
                FirstName = "Lívia",
                LastName  = "Emanuelly Elisa",
                CPF       = cpf,
                Email     = "*****@*****.**",
                Phone     = "(21) 2682-8370",
                Degree    = EDegree.Master
            };

            commandUpdate = new ProfessorInputUpdate()
            {
                ProfessorId = professor.Id,
                FirstName   = "Lívia",
                LastName    = "Emanuelly Elisa",
                Email       = "*****@*****.**",
                Phone       = "(21) 2682-8370",
                Degree      = EDegree.Master
            };
        }
コード例 #2
0
 public ProfessorController(ProfessorQueryHandler professorQuery, ProfessorCommandHandler professorCommand, UserQueryHandler userQuery) : base(userQuery)
 {
     _professorQuery   = professorQuery;
     _professorCommand = professorCommand;
 }