Base solution for your next web application

Activities of "nanouz"

Hi,

I'm trying to make a Register/Login screen. I started with the boilerplate template and added the module zero packages. I don't have to work with multiple tenants. I got this code for register :

    [HttpPost]
    public async Task<ActionResult> Register(RegisterModel model)
    {
        var user = new User
        {
            Name = model.FirstName,
            Surname = model.LastName,
            UserName = model.Email,
            EmailAddress = model.Email,
            Password = new PasswordHasher().HashPassword(model.Password),
            IsActive = true,
            Roles = new List<UserRole>()
        };
        
        user.Roles.Add(new UserRole { RoleId = 3 }); // Role: Researcher

        await _userManager.CreateAsync(user);

        return RedirectToAction("Login");
    }

Whenever I try to register I get the error: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_dbo.AbpUsers_dbo.AbpTenants_TenantId". The conflict occurred in database "Agrolink", table "dbo.AbpTenants", column 'Id'. The statement has been terminated.

I tried added a default Tenant in the database and added TenantId in the User object but I get the same error. I don't understand tenants really and no idea why I this error pops up.

Any help is much appreciated!

My bad, I saw too late it was not supported yet. Im trying my luck with EF.

Hi,

I'm starting a new project and want to use this template. I'm working with ASP MVC and NHibernate. The boilerplate works perfectly but I also need a login system there for I need the Module Zero template but here I don't have the option to choose NHibernate and multi page application. Is there anyway I can achieve this?

Thx!

Showing 1 to 3 of 3 entries