コード例 #1
0
        public void CreateDefaultRoles()
        {
            _rolesRepository.AddRol(new Rol
            {
                CreatedAt = DateTime.Now,
                Name      = UserRoles.Customer.ToStringValue(),
                UpdatedAt = DateTime.Now,
            });

            _rolesRepository.AddRol(new Rol
            {
                CreatedAt = DateTime.Now,
                Name      = UserRoles.Salesman.ToStringValue(),
                UpdatedAt = DateTime.Now,
            });

            _rolesRepository.AddRol(new Rol
            {
                CreatedAt = DateTime.Now,
                Name      = UserRoles.Manager.ToStringValue(),
                UpdatedAt = DateTime.Now,
            });

            _rolesRepository.AddRol(new Rol
            {
                CreatedAt = DateTime.Now,
                Name      = UserRoles.Administrator.ToStringValue(),
                UpdatedAt = DateTime.Now,
            });

            _rolesRepository.AddRol(new Rol
            {
                CreatedAt = DateTime.Now,
                Name      = UserRoles.SuperUser.ToStringValue(),
                UpdatedAt = DateTime.Now,
            });
        }
コード例 #2
0
 private void AddRol(Rol rol)
 {
     rol.CreatedAt = DateTime.Now;
     rol.UpdatedAt = DateTime.Now;
     _rolesRepository.AddRol(rol);
 }