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

Activities of "winson"

Not only for ABP framework, but I just want to know is possable to make a entity for a table view in code first? or are there any ways can do that in ABP ?

thanks!!

Oh, sorry, I didn't read that careful :(

thank you!!

I am using the default ICacheManager, so should be use MemoryCache, but how can I set the expire time for it? and what's the default expire time?

thanks!

ok, I see, thank you!!

I need to dynamic to generate the URL with URL route, because I need to handle the root or subfolder deployment issue, so I want to generate url like below:

UrlHelper url = new UrlHelper(HttpContext.Current.Request.RequestContext);

var menuUrl= url.RouteUrl(new { Controller = "Home", Action = "Index" });

new MenuItemDefinition(
                        "Home",
                        new FixedLocalizableString("Home"),
                        url: menuUrl,
                        icon: "fa fa-home",
UserRole.JOURNALIST
                        )

but it's can't get the HttpContext.Current.Request.RequestContext in NavigationProvider class, so any ideas?

Thanks!

oh, sorry, I found the issue, for unitOfWork must be use the virtual method!!

thanks!

If don't use Update method, I just can use the below code for update the data with unitOfWork:

using (var unitOfWork = _unitOfWorkManager.Begin())
{
     ....
}

Hi, I just tried this these days, but seems doesn't work, if I didn't call the update method, and the record can't be update, I also try to add the UnitOfWork Attribute but still doesn't work, and support my service should not need to add the UnitOfWork attribute, right? my service class has been inherit the applicationService and IApplicationService

oh, that's great! thanks!!

hi, I want to do some auditlog for the field values changed with below:

foreach (var entry in ChangeTracker.Entries<FormDataDetail>().Where(a => a.State == EntityState.Modified))
{    
    if (entry.CurrentValues["FieldValue"].ToString() != entry.OriginalValues["FieldValue"].ToString())
    {
       //to do some auditlog
    }
}

but the problem is the OriginalValues always same with the current value, and after I review the ABP source code, I find the below code in update function:

public override TEntity Update(TEntity entity)
        {
            AttachIfNot(entity);
            Context.Entry(entity).State = EntityState.Modified;
            return entity;
        }

I think the problem is

Context.Entry(entity).State = EntityState.Modified;

for the detail, you can take a look this article.

so can we fix this issue?

for now, I have to get the OriginalValues from db again, like below:

var oldValue = entry.GetDatabaseValues().GetValue<string>("FieldValue");

thanks!

Showing 1 to 10 of 25 entries