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

Activities of "pankajmathur"

Answer

Hi,

One more small question regarding hangfire....

In SQL database tables, can I figure out when a task that is scheduled is about to run (I mean date and time)....

Regards, Mahendra

Answer

Thanks aaron....It worked...cheers....

Answer

Hi,

I did not understand you fully what do you mean by domain class. Could you please provide me a sample or provide me a link where I can read more about domain class.

By the way, I saw a strange behavior. Please have a look at the following code.

Hangfire Code (Please note that this class is not decorated with ABPAuthorize attribute)


public override void Execute(DataImportJobArgs dataImportJobArgs) {

        Task ImportTask = Task.Run(() => ImportData(dataImportJobArgs));
        ImportTask.Wait();
    }

private async Task ImportData(DataImportJobArgs dataImportJobArgs) { ImportAppService = (IImportAppService)IocManager.Instance.Resolve(typeof(CustomerAppService)); await ImportAppService.ImportData(dataImportJobArgs.DataToImport, false); }

CustomerAppService Code ((This class is decorated with ABPAuthorize attribute)


public async Task<DataTable> ImportData(DataTable dataTable, bool ImportInBackground = true) { CustomerDto ExistingCustomer = GetCustomerByEntityId(Row["CustomerId"].ToString());

    }

public CustomerDto GetCustomerByEntityId(string EntityId) { CustomerDto Customer = _CustomerRepository.FirstOrDefault(x => x.EntityId == EntityId).MapTo<CustomerDto>();

        if (Customer != null && Customer.AddressKey != 0)
            Customer.CustomerAddress = AddressAppService.GetAddress(Customer.AddressKey);

        return Customer;
    }

Now, the Background job is able to call the ImportData method of CustomerAppService (Though the CustomerAppService is decorated with ABPAuthorize). However GetCustomerByEntityId method of CustomerAppService is not able to call the GetAddress method of AddressAppService (Which is yet another AppService decorated with ABPAuthorize attribute)

So the flow is:

  1. Hangfire Background Class calls the CustomerAppService (Which gets called successfully) and then
  2. CustomerAppService calls the AddressAppService (Which gets failed).

Please note that both the above AppService is decorated with ABPAuthorize. The strange behavior that I feel is if customer is not logged in then why even the method CustomerAppService is getting invoked by Background Job class. (In my Case why even the ImportData method of CustomerAppService is getting called.

Please help me.

Question

Hi,

My application services class is decorated with ABPAuthorize attribute. This has been done so as to avoid any unauthenticated user to call any of my service method. Due to this I am trap with a problem. I am using hangfire. Once a user import an excel file, I put the excel data in Hangfire Job. Now when The hangfire start executing, it calls a method of the service to check whether the data imported already available in the database. Now since my service class is decorated with ABPAuthorize attribute, it does not allow the hangfirew to call the service method and it says "The current user did not login to the application". If I decorate the service method with ABPAllowAnonymous, it works fine. But I dont want the method to be called anonymously.

Please help me how can I successfully let the hangfire call the service method.

Regards, Mahendra

Question

Hi,

From where can I enable multiple time zone support. I don't see the same either on the Tenant Setting page or on the Host Setting Page. Also what should be the setting in the following case

  1. Server is on Azure and is hosted in US
  2. Tenant is in India
  3. Another Tenant is in Australia.
Question

We are using the date picker control using <input type="text" class="form-control date-range-picker" /> The issue is that when the culture is set to en-IN then the format of the date should automatically change to dd/MM/yyyy whereas it still shows MM/dd/YYYY. How can we change the default behavior of this.

What we have done is dropped the FK on the column. However the payment is going in the tenant database and not in the host database. Is that ok or should it work the other way.

Question

Hi, In our existing MVC5.x application when the multi tenancy is turned on and user enters the invalid name, the page 505 was displayed. For eg. if someone type (<a class="postlink" href="http://www.abc.applicationname.com">www.abc.applicationname.com</a>) and if abc is not a valid tenant, page 505 was appearing. However after migrating to .net core 2.0 project we observe that it takes opens the login page and if the user enters the credential of host on that page they are able to login. Can you please let me know as where and what to change so that if the invalid tenant is specified the user is redirected to a 505 page and not shown the login page.

Question

Hi, In our earlier MVC5.x project we have written rule in our web config file. Can you please let me know where and how to write this when migrated to .netcore 2.0. Thanks in advance

<system.webServer> <rewrite> <rules> <rule name="Redirect to https"> <match url="(.*)"/> <conditions> <add input="{HTTPS}" pattern="Off"/> </conditions> <action type="Redirect" url="https://{HTTP_HOST}/{R:1}"/> </rule> </rules> </rewrite> </system.webServer>

Answer

[AutoMapTo(typeof(TaxCode))] public class CreateOrUpdateTaxCodeDto: Entity { [Required] [MaxLength(20)] public string EntityId { get; set; }

    [Required]
    [MaxLength(100)]
    public string Description { get; set; }

    [Required]
    public decimal Rate { get; set; }
    
}
Showing 81 to 90 of 123 entries