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

Activities of "sparkyjr"

Is there any way I can register my services explicitly like this in the aspnet zero template. builder.RegisterType<ExampleService>().As<IExampleService>(); (done using Autofac)

Another query is why is GetRecentlyUsedLinkedUsers method getting called more often between 2 - 3 requests?

Also can I get preview of AspNet Zero source code? I have a paid subscription.

Question

Hi,

I need inline editing(inplace) functionality for jTable i.e without opening a modal. How do I achieve this using a jTable.

Thanks in advance.

Hi,

I need to call a Web API (App Service) from PowerApps. Problem is, I cannot pass the authentication token in the request header. PowerApps uses the Authorization request header key to pass their own token. How can I pass my authentication key? Also, is there any other way to fetch records of specific tenant if I can't pass my token into Authorization key?

Thanks in advance!

Regards, SparkyJr

jTable that is used in this framework has the ability to show hide columns. But it does so using a right click on the column header which is not very obvious to the user. Is there any way I can show it as a separate dropdown with normal click( i.e left click).

Thanking you in advance!!!

I am not able to understand why the function CssRewriteUrlWithVirtualDirectoryTransform() is written in MpaBundleConfig.cs. What does that function do? And it has come to my notice that if I don't pass that function as an argument in .Include()(ex .Include(StylePaths.FontAwesome, new CssRewriteUrlWithVirtualDirectoryTransform())) it does not give me .woff errors.

Please explain to me the purpose of the above mentioned function.

My requirement is to update only certain columns of an Entity. The primary key, and any no of other columns from that entity will be supplied by the user, and I have to update this entity with these new values.

One solution for this is using the DBContext as mentioned [https://stackoverflow.com/a/21350893/2313371])

public static void Update(int id, string name, string family)
{
    var _person = new Person() { Id = id , Name = name };

    using (var newContext = new MyDbContext())
    {
        newContext.Persons.Attach(_person);
        newContext.Entry(_person).Property(X => X.Name).IsModified = true;
        newContext.SaveChanges();
    }
}

And the same can be made in a Generic fashion as described here [http://patrickdesjardins.com/blog/how-to-update-specific-field-of-your-entity-with-a-generic-method-and-entity-framework])

public int Update(T entity, Expression<Func<T, object>>[] properties)
{
      DatabaseContext.Entry(entity).State = EntityState.Unchanged;
      foreach (var property in properties)
      {
           var propertyName = ExpressionHelper.GetExpressionText(property);
           DatabaseContext.Entry(entity).Property(propertyName).IsModified = true;
      }
      return DatabaseContext.SaveChangesWithoutValidation();
}

and use it as

...Update(Model, d=>d.Name); //or ...Update(Model, d=>d.Name, d=>d.SecondProperty, d=>d.AndSoOn);

How can we achieve this in our ABP framework?

One way is to fetch the entity, and update necessary columns as described below

int id = 10;
string newName,newAge;
var _person = _personRepository.Get(id);

if(nameColumnModified())
  _person.Name = newName;

if(ageColumnModified())
  _person.Age = newAge;

_personRepository.Update(_person );

I want to know if there is a better way to do this, like the one mentioned above using the DBContext method?

Hi,

Our ABP module seem to be constantly re-initializing in production. It seems to be happening every couple of minutes. I haven't been able to pin point it to a particular trigger, but I do see this happening as frequently at once every 2 - 3 minutes. Sometimes there is as much as 20 minutes delay between log entries.

I don't see this happening every time. First time when I load the app, I see log entry of 19 ABP modules getting loaded, but then I see log entries for 18 ABP modules getting loaded over and over, followed by automapping and web api controller recreation each time.

We have a background service running and there is a call to stop it before each reload. Any ideas what would be triggering reloading of modules and remapping. I suspect this could be the reason for the slow performance I am seeing on Azure.

Here is the truncated logs, similar entries are showing up every so many minutes.

DEBUG 2017-05-08 08:43:09,228 [48   ] Abp.BackgroundJobs.BackgroundJobManager  - Stop background worker: Abp.BackgroundJobs.BackgroundJobManager
DEBUG 2017-05-08 08:43:09,228 [48   ] BackgroundWorker.ActualUpdationDueWorker - Stop background worker: Castle.Proxies.ActualUpdationDueWorkerProxy
DEBUG 2017-05-08 08:43:09,228 [48   ] Abp.BackgroundJobs.BackgroundJobManager  - WaitToStop background worker: Abp.BackgroundJobs.BackgroundJobManager
DEBUG 2017-05-08 08:43:09,228 [48   ] BackgroundWorker.ActualUpdationDueWorker - WaitToStop background worker: Castle.Proxies.ActualUpdationDueWorkerProxy
DEBUG 2017-05-08 08:43:10,684 [58   ] Abp.Modules.AbpModuleManager             - Loading Abp modules...
DEBUG 2017-05-08 08:43:11,309 [58   ] Abp.Modules.AbpModuleManager             - Found 18 ABP modules in total.
DEBUG 2017-05-08 08:43:11,324 [58   ] Abp.Modules.AbpModuleManager             - Loaded module: PlanQube.Web.PlanQubeWebModule, PlanQube.Web, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null

.............
DEBUG 2017-05-08 08:43:11,340 [58   ] Abp.Modules.AbpModuleManager             - Loaded module: Abp.Hangfire.AbpHangfireModule, Abp.HangFire, Version=0.8.3.0, Culture=neutral, PublicKeyToken=null
DEBUG 2017-05-08 08:43:11,496 [58   ] Abp.Modules.AbpModuleManager             - 18 modules loaded.
DEBUG 2017-05-08 08:43:11,621 [58   ] o.Configuration.LanguageManagementConfig - Converted Abp (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource
DEBUG 2017-05-08 08:43:11,637 [58   ] o.Configuration.LanguageManagementConfig - Converted AbpWeb (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource
DEBUG 2017-05-08 08:43:11,637 [58   ] o.Configuration.LanguageManagementConfig - Converted AbpZero (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource
DEBUG 2017-05-08 08:43:11,637 [58   ] o.Configuration.LanguageManagementConfig - Converted PlanQube (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource
DEBUG 2017-05-08 08:43:15,543 [58   ] Abp.Localization.LocalizationManager     - Initializing 4 localization sources.
DEBUG 2017-05-08 08:43:15,590 [58   ] Abp.Localization.LocalizationManager     - Initialized localization source: Abp
DEBUG 2017-05-08 08:43:15,606 [58   ] Abp.Localization.LocalizationManager     - Initialized localization source: AbpWeb
DEBUG 2017-05-08 08:43:15,606 [58   ] Abp.Localization.LocalizationManager     - Initialized localization source: AbpZero
DEBUG 2017-05-08 08:43:15,621 [58   ] Abp.Localization.LocalizationManager     - Initialized localization source: PlanQube
DEBUG 2017-05-08 08:43:15,731 [58   ] Abp.BackgroundJobs.BackgroundJobManager  - Start background worker: Abp.BackgroundJobs.BackgroundJobManager
DEBUG 2017-05-08 08:43:16,981 [58   ] Abp.AutoMapper.AbpAutoMapperModule       - Found 149 classes defines auto mapping attributes
DEBUG 2017-05-08 08:43:16,981 [58   ] Abp.AutoMapper.AbpAutoMapperModule       - PlanQube.Web.Areas.Mpa.Models.Users.UserPermissionsEditViewModel

....

DEBUG 2017-05-08 08:43:17,605 [58   ] Abp.AutoMapper.AbpAutoMapperModule       - PlanQube.Authorization.Users.Dto.UserListDto+UserListRoleDto
DEBUG 2017-05-08 08:43:17,621 [58   ] Abp.Logging.LogHelper                    - Dynamic web api controller is created for type 'PlanQube.Tenants.Dashboard.ITenantDashboardAppService' with service name 'app/tenantDashboard'.
DEBUG 2017-05-08 08:43:17,637 [58   ] Abp.Logging.LogHelper                    - Dynamic web api controller is created for type 'PlanQube.Sessions.ISessionAppService' with service name 'app/session'.

......

DEBUG 2017-05-08 08:43:17,918 [58   ] Abp.Logging.LogHelper                    - Dynamic web api controller is created for type 'PlanQube.ApplicationServices.ImportData.IImportDataAppService' with service name 'app/importData'.
DEBUG 2017-05-08 08:43:40,135 [58   ] BackgroundWorker.ActualUpdationDueWorker - Start background worker: Castle.Proxies.ActualUpdationDueWorkerProxy
WARN  2017-05-08 08:43:58,713 [37   ] Abp.Auditing.WebAuditInfoProvider        - Could not obtain web parameters for audit info.

I am getting .woff (500 Internal server error) when my website is hosted on the server. I have tried adding the following line to the web config. <staticContent> <remove fileExtension=".woff" /> <remove fileExtension=".woff2" /> <mimeMap fileExtension=".woff" mimeType="application/font-woff" /> <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" /> </staticContent>

Also I have tried some help from the internet , but it did not help.

Hi,

I need to call a SQL stored proc from an app service. For that I will need access to the DBContext. I don't think I can access it directly from Application project.

What is the correct way to call a SQL stored proc and UDF from an app service?

Thanks, SparkyJr

We've had our production service on Azure. Locally, our aspnetzero application runs pretty fast (always < 4 sec PLT) but on Azure, we are seeing extremely long load times. Some pages take over a minute to load, with typical page load times in 30 - 40 sec range. Often it seems the initial controller call seems to be taking the most time with Glimpse stating that the Action of the Controller taking the most time. It also does not appear to be a cold boot issue, since even after setting AlwaysOn = true, we see the pages become slow if now accessed after a while.

The exact same database and configuration loaded on a local or network box is many times faster. Is there something specific to Azure that inhibits Asp.NET Zero application performance? Perf profiling did not seem to show any obvious issues.

Has anyone faced these problems before? Any help on why it is working incorrectly only on Azure?

Showing 11 to 20 of 32 entries