Here is my Entity Class, CacheItem and Cahe Class...
`[Table("InvProductGroup")]
public class ProductGroup : MCFullAuditedEntity
{
[Column("ProductGroupKey")]
[Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
[MaxLength(BaseEntityConsts.MaxKeyLength)]
public override string Id { get; set; }
[Column("Id")]
[Required]
[MaxLength(BaseEntityConsts.MaxEntityIDLength)]
public virtual string EntityId { get; set; }
[MaxLength(BaseEntityConsts.MaxDescriptionLength)]
public virtual string Description { get; set; }
}
[AutoMapFrom(typeof(ProductGroup))]
public class ProductGroupCacheItem
{
public const string CacheName = "ProductGroup";
public string EntityId { get; set; }
public string Description { get; set; }
}
public class ProductGroupCache: MustHaveTenantEntityCache<ProductGroup, ProductGroupCacheItem, string>, ITransientDependency
{
public ProductGroupCache(ICacheManager cacheManager, IUnitOfWorkManager unitOfWorkManager, IRepository<ProductGroup, string> repository)
: base(cacheManager, unitOfWorkManager, repository)
{
}
}`
Now in the appService, when I try to get a productGroup having id - 10000000000001 using below code
`var abc = _cacheManager
.GetCache(ProductGroupCacheItem.CacheName)
.Get("10000000000001", ()=> someMethod());`
it goes to someMethod (below)...which is fine and then in the subsequent call, it does not go into someMethod...which is also fine.
`private async Task<ProductGroupDto> someMethod()
{
return ObjectMapper.Map<ProductGroupDto>(await _productGroupRepository.FirstOrDefaultAsync("10000000000001"));
}`
But when I update the productGroup having id 10000000000001, it updates the productGroup using following code
`ProductGroup productGroup = await _productGroupRepository.GetAsync(createOrUpdateProductGroupDto.Id); ..... .....
ObjectMapper.Map(createOrUpdateProductGroupDto, productGroup); await _productGroupRepository.UpdateAsync(productGroup);`
After the above update, when I try to fetch the productGroup 10000000000001 again, I am expecting the someMethod function to be called as it should invalidate the cache, but it does not....
Hi Expert,
This is related to caching in ABP. I am referring to the below link: https://aspnetboilerplate.com/Pages/Documents/Caching
Is the statement "It automatically invalidates a cached entity if this entity is updated or deleted. Thus, it will be retrieved from the database in the next call." still valid. I don't see in my code this getting invalidated.
In the below code: the someMethod gets called once only. even after the productGroup 10000000000001 being updated....
Any clue?
private async Task<ProductGroupDto> someMethod() { return ObjectMapper.Map<ProductGroupDto>(await _productGroupRepository.FirstOrDefaultAsync("10000000000001")); }
var abc = _cacheManager .GetCache(ProductGroupCacheItem.CacheName) .Get("10000000000001", ()=> someMethod());
Hi Team, you informed us that this issue will be resolved in next aspnetzero tool or aspnetzero framework. I could not find the solution in 14/08/2020 release of the tool. Please let us know the tentative date by when this is expected. Also, please priortize this issue as our release is impacted. Regards, Mahendra
Product Version: 8.2.0 Product: Angular with asp.net core
Newly created user is getting the issue while resetting the password after first time user try to login with temporary password. Steps for same are mentioned in screenshot.
Step 1- Enable login captcha from setting Step-2 Create new user Step -3 open mail Step-4 After verify mail Step-5 after putting credentials from mail Step-6 redirect from login page to reset page (Change password screen same as of original framework screen only UI is changed) Step-7 now we get this issue
Hi,
I merged the PR as asked by you. The lock screen is getting displayed on session timeout.
But when I enter the password in the lock screen, it lands me to my default page and NOT on the page where I was. Is this the default behavior? IF yes, how can I land up on the page where I was prior to my lock screen.
Regards, Mahendra
Hi,
I think I was not able to make you understand about plain text password. Let me try to explain the use case.
We are creating a retail application that have a component called Web Point of Sales (Web POS). Let’s say a user only has the rights on POS component. So when he logs into the system and he straight away lands on the POS screen. He continues doing sale. Now for some time he needs to leave his computer etc. and he wanted to just lock his screen (of course he can lock the complete computer itself). When he comes back he presses a button called unlock. Here the system would ask him to enter password and if the password is valid/matches, he should be able to unlock the screen and lands up on POS screen.
Please advise how can we achieve the matching of credential.
Regards, Mahendra
Hi Aspnetzero team,
Any update for us as we are stuck in extending or using the role and permission model.
Regards, Mahendra
We are going to create new entity via asp.net zero power tool in which we have to link RoleId of "Role" table. We have a option to Add new navigation property via "Navigation Properties" tab. From "Select your entity" dropdown we can select which entity we want to link but as you can see in screenshot "Role" entity is not there while other entities like: "OrganizationUnit" and "User" are present. Is there any way workaround of this issue or is it any bug? If it is bug can you please resolve it ASAP and provide us updated version of tool. FYI, we are using "2.5.0" version of this tool.
Hello Expert,
Is there a way I can authenticate a user from inside the application. I have userId and password in plain text. I am trying to create a lock screen.I know you have provided this functionality in version 8.2. But we are on 8.0 and currently its not possible for us to upgrade it to 8.2 or on latest.
I just want to autheticate a user. Don't want to create a new session.
Please advise..
Regards, Mahendra