Base solution for your next web application

Activities of "omital"

How can I inject common repositories to AppServiceBase?

Hi. It's possible to use repositories in seed data? Is that a common approach?

Hi. I did this for set 'fa-ir' for default language:
1: just add this line of code in PreInitialize method

Configuration.Localization.Languages.Add(new LanguageInfo("fa-IR", "Farsi", "famfamfam-flag-ir", true));

2: and this in seed data

new ApplicationLanguage(null, "fa-IR", "فارسی", "famfamfam-flag-ir"),

also read this topic "Configuring Default Language For Application" in forum. But noting work?! when user load page for first time default language is "en", and user have to click on link [http://something:6234/AbpLocalization/ChangeCulture?cultureName=fa-IR]) in order to change the language. and this is screenshot from coockies

Hi, How can I disable auto view error dialog message after appService's method call? for now after each app service's method execution, abp automatically handle it and view a message to user, even throw UserFriendlyException or AbpException

Can I write my own permission manager for permission check? If "Yes", How implement it? Why I need it: we implement mechanism than user must select Subsystem after login, in a result we have CurrentSubsystem in session. Now, we want implement permission for each Subsystem separately. for example suppose below application service's method:

[AbpAuthorize(new string[] { "ACC.BaseTables.Person.Update" ,"ISO.BaseTables.Person.Update"})]
public void UpdatePerson(){
     //method implementation 
}

We want authorize based on Current selected Substystem (ACC or ISO) that stored in session.

I have a Custom session called LIMSSession like this

public class LIMSSession : ITransientDependency
    {
        public int? SubsystemId
        {
            get
            {
                var claimsPrincipal = Thread.CurrentPrincipal as ClaimsPrincipal;
                if (claimsPrincipal == null)
                {
                    return null;
                }


                var emailClaim = claimsPrincipal.Claims.FirstOrDefault(c => c.Type == "SubsystemId");
                if (emailClaim == null || string.IsNullOrEmpty(emailClaim.Value))
                {
                    return null;
                }


                return Convert.ToInt32(emailClaim.Value);
            }
        }
    }

SubsystemId initialized after user select current subsystem (after login page) How I can inject LIMSSession to AbpNavigationProvider?

Suppose below app service

public void CreatePerson(CreatePersonInput input)
    {
        var person = new Person { Name = input.Name, EmailAddress = input.EmailAddress };
if(_personRepository.Any().Count()>10)
throw new UserFriendlyExceptio("some error message");
        _personRepository.Insert(person);
   }

based on Abp documentation application service is already implement unitOfWork. but when I send two or more request continuously, exception not fire

Hi, why all datetime fields in application service methods automatically converted to PersianDateTime and then return to client?

Hi, first of all I create new NameValue in claims that initial in login method, after that I declare a data filter that called "bookId". for now I set "bookId" manually in each application service's methods for example:

CurrentUnitOfWork.SetFilterParameter("BookFilter", "bookId", _sessionAppService.CurrentBookId());

How can set bookId in entire project like tenantId data filter?

Hi, I set application to use different db for each tenant. How I can read data from tenant's db that requested login, in Login action?

public async Task<JsonResult> Login(LoginViewModel loginModel, string returnUrl = "", string returnUrlHash = "")
        {
            CheckModelState();

            var loginResult = await GetLoginResultAsync(
                loginModel.UsernameOrEmailAddress,
                loginModel.Password,
                loginModel.TenancyName
                );

            

            await SignInAsync(loginResult.User, loginResult.Identity, loginModel.RememberMe);
            
            if (string.IsNullOrWhiteSpace(returnUrl))
            {
                returnUrl = Request.ApplicationPath;
            }

            if (!string.IsNullOrWhiteSpace(returnUrlHash))
            {
                returnUrl = returnUrl + returnUrlHash;
            }

            var book = _bookRepo.GetAll().SingleOrDefault();

            return Json(new MvcAjaxResponse { TargetUrl = returnUrl });
        }

In above code I want read Book item from tenant's db that request to login

Showing 11 to 20 of 43 entries