Base solution for your next web application

Activities of "omital"

Can you share a simple example please?

Yes this should, but it is hard code and Language menu (user select language from drop down menu) does not work anymore. Dose any other suggestion?

Hi, Thank you for your response. Yes I Checked it and it was

lang=@System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName>

in layout.cshtml page. I want to when user visit site for the first time ,[lang] attribute be "fa-ir" and then user can change it from language menu.

Hi, Thank you for your response.

13 View for this post without any response? :(

Hi and thank you for your response. I update abp.* again and it work.

I create new project with asp.netBoilerplate abp and abp.web version are 7.3.0 but in project that I faced with problem abp and abp.web version are 7.4.0 therefore I use latest version but I received this error ".Mvc.Controllers.AbpHandleErrorAttribute - System.MissingMethodException: Method not found: 'Abp.Application.Features.IFeatureDependency Abp.Authorization.Permission.get_DependedFeature()'"

Thank you for your response. I cheeked all package and some of them has been upgrade to new version but I received error

Mvc.Controllers.AbpHandleErrorAttribute - System.MissingMethodException: Method not found: 'Abp.Application.Features.IFeatureDependency Abp.Authorization.Permission.get_DependedFeature()'.

in error log and also navigation system does not work properly (abp.nav is null)

Work like a charm. Thank you man :) ;)

<cite>hikalkan: </cite> Hi,

I will share a simplified version of AspNet Zero's registration code for you:

[HttpPost]
[UnitOfWork]
public virtual async Task<ActionResult> Register(RegisterViewModel model)
{
   try
   {
       if (!_multiTenancyConfig.IsEnabled)
       {
           model.TenancyName = Tenant.DefaultTenantName;
       }
       else if (model.TenancyName.IsNullOrEmpty())
       {
           throw new UserFriendlyException(L("TenantNameCanNotBeEmpty"));
       }

       var tenant = await GetTenantAsync(model.TenancyName);

       var user = new User
       {
           TenantId = tenant.Id,
           Name = model.Name,
           Surname = model.Surname,
           UserName = model.UserName,
           EmailAddress = model.EmailAddress,
           Password = new PasswordHasher().HashPassword(model.Password),
           IsActive = true
       };

       _unitOfWorkManager.Current.EnableFilter(AbpDataFilters.MayHaveTenant);
       _unitOfWorkManager.Current.SetFilterParameter(AbpDataFilters.MayHaveTenant, AbpDataFilters.Parameters.TenantId, tenant.Id);

       user.Roles = new List<UserRole>();
       foreach (var defaultRole in await _roleManager.Roles.Where(r => r.IsDefault).ToListAsync())
       {
           user.Roles.Add(new UserRole { RoleId = defaultRole.Id });
       }

       CheckErrors(await _userManager.CreateAsync(user));
       await _unitOfWorkManager.Current.SaveChangesAsync();

       //Directly login
       var loginResult = await GetLoginResultAsync(user.UserName, model.Password, tenant.TenancyName);
       if (loginResult.Result == AbpLoginResultType.Success)
       {
           await SignInAsync(loginResult.User, loginResult.Identity);
           return Redirect(Url.Action("Index", "Application"));
       }
   }
   catch (UserFriendlyException ex)
   {
       ViewBag.ErrorMessage = ex.Message;
       return View(model);
   }
}

I hope this helps you and others.

I have this problem too. but I use SPA version with angularjs. Is your solution difference ? I cant find _multiTenancyConfig in application layer

Edit: I think AbpSession that injected to application service for this purpose?! Is it true?

Showing 41 to 50 of 56 entries