Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

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!

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 2 of 2 entries