We want to use the extention methods used in this package : KeyDeleteWithPrefix() and KeyCount()
We followed the ABP's Caching Documention and aded Abp.RedisCache in Web.Core's Project Module.
We added this in DependsOn Annotation and enable redis by using below
//See app.config for Redis configuration and connection string
Configuration.Caching.UseRedis(options =>
{
options.ConnectionString = _appConfiguration["Abp:RedisCache:ConnectionString"];
options.DatabaseId = _appConfiguration.GetValue<int>("Abp:RedisCache:DatabaseId");
});
Then I created a helper class for Redis Caching and injected
public class RedisCacheHelper : IRedisCacheHelper
{
private readonly IConfigurationRoot _appConfiguration;
private readonly AbpRedisCacheManager _cacheManger;
public RedisCacheHelper(IHostingEnvironment env, AbpRedisCacheManager cacheManger)
{
_appConfiguration = env.GetAppConfiguration();
_cacheManger = cacheManger;
}
}
Earlier we were using IDistributedCache in place of AbpRedisCacheManager. After doing these steps we are not able to find any methods to add or get value with particular key in Redis cache like we had in IDistributedCache. We also not able to get redis database (IDatabase) which contains the methods KeyDeleteWithPrefix() and KeyCount()
How can we implement this ?
We have a owners module in our application and need to perform CRUD operations for some field in this module. For this we have created owner appservice. We are injecting IOwnerRepository and using the same for the CRUD operations. This IOwnerRepository is inheriting from IOwnerRepository: IRepository<Owner, int>
Below is the code snippet we are using for the insert and update. In this code we are wanting to use the CheckErrors function which logs the error using log4net as well as throws a user friendly message(Similar to what is used in the UserAppService)
public async Task CreateOrEdit(CreateOrEditOwnerDto input)
{
try
{
ValidateOwners(input);
if (input.Id == null)
{
var owner = ObjectMapper.Map<Owner>(input);
await _customOwnerRepository.InsertAsync(owner);
}
else
{
var updateOwner = _customOwnerRepository.Get(input.Id.GetValueOrDefault());
ObjectMapper.Map(input, updateOwner);
CurrentUnitOfWork.SaveChanges();
}
}
catch(Exception ex)
{
throw new UserFriendlyException(ex.Message);
}
}
unfortunately we are unable to use the CheckErrors function(as used in the UserAppService) cause the return type is not Task<IdentityResult>. Could you please let us know how can this be achieved in one shot without explicitly logging and throwing error.
Also, please let us know if we are correct on the below points:
How can CheckErrors be implemented in all our AppServices
We are using Angular and .net core, aspnetzero framework.
For all the CRUD operations Insert/ Update we are using ObjectMapper to map the entity with the dto All the insert/ update dto's are exact replica of their respective entities(which are created using the RAD tool based on their SQL tables)
Now, there are 4 common columns in all the SQL tables and also the entities and we have created the same in the dto's as well. The 4 columns are:
We need to update the first 2 columns during a create operation and the remaining 2 when we update a record. There are 2 different ways we have tried to implement this:
We have explored the UserAppService code where we are inheriting AbpUser class and this internally inherits multiple interface which are setting the user and datetime. But all of this is in aspnetzero core dll and we are unable to use the same.
Could you please let us know the right way to implement this without writing redundant code.
Hi,
We need to completely disable the background jobs in our project. we have tried :
Configuration.BackgroundJobs.IsJobExecutionEnabled = false;
in the WebCoreModule.cs, Core Project >> CoreModule.cs but checking the queries in the SQL profiler, the below query is getting fired almost every 2 seconds
exec sp_executesql N'SELECT TOP(@__p_1) [t].[Id], [t].[CreationTime], [t].[CreatorUserId], [t].[IsAbandoned], [t].[JobArgs], [t].[JobType], [t].[LastTryTime], [t].[NextTryTime], [t].[Priority], [t].[TryCount]
FROM [AbpBackgroundJobs] AS [t]
WHERE ([t].[IsAbandoned] = 0) AND ([t].[NextTryTime] <= @__Now_0)
ORDER BY [t].[Priority] DESC, [t].[TryCount], [t].[NextTryTime]',N'@__p_1 int,@__Now_0 datetime2(7)',@__p_1=1000,@__Now_0='2019-12-09 16:21:02.3694549'
could you please let us know how to completely stop these background jobs.
Hello,
For Angular-Core project currently 34-35 odd tables are getting created in the DB. Can we get any documentation as to what tables are used for what purpose.
We are in process of moving the developed application onto Production, so before that we want to sure what tables need to be pushed into prod sql db.
Also, once the tables are into production, how do we maintain the tables. Let me explain the below scenrio:
Hello,
We have been using the RAD tool to generate entities and basic UI's and we are able to do that swiftly, Thank you!!!
While working on development of one of the functionalities, we need to develop something similar to "Import from Excel" functionality provided in the Users module(by default).
There is no any option for "Import from excel" in the RAD tool, altough there is an option "Create Excel Export Button".
How can we implement this functionality using the RAD tool so that the development time would get reduced. Is it something in the RAD tool with which this can be achieved.
Also, if this is not possible using the RAD tool, could you please explain how this can be achieved in aspnetzero. We have a excel sheet with fixed columns and we would want to apply validations as well as if all the validations pass, would want to upload the file and insert the records in a particular SQL table.
We have cached three entities using Entity Caching by referring the below documentation. https://aspnetboilerplate.com/Pages/Documents/Caching#entity-caching
We have to perform a linq on these cached enitites. Below is the linq perform using the repository.
var mailers = (from mailer in _mailerRepository.GetAll() join groupBroker in _groupBrokerRepository.GetAll() on mailer.BrokerID equals groupBroker.BrokerID join userGroup in _userGroupRepository.GetAll() on groupBroker.GroupID equals userGroup.GroupID where mailer.iIsActive && userGroup.UserId == _mySession.IDMSUserId && mailer.DatabaseID == input.DatabaseID && _offerRepository.GetAll().Any(offer => offer.MailerId == mailer.Id) orderby mailer.cCompany select mailer).Distinct();
We are not able to do the same with entity caching as EntityCacheBase class does have any method implemented which returns List<TCacheItem>. Could you please help us out and explain how can we implement this.
Hi,
We have 2 load balanced web server and we need to implement distributed caching for some of the frequently used SQL tables. The documentation is not clear, https://aspnetboilerplate.com/Pages/Documents/v1.5.2/Caching
https://docs.aspnetzero.com/documents/aspnet-core-mvc/latest/Infrastructure-Core-Mvc-Caching
We have uncommented the code for Redis in the pre initialize method of the webcoremodule.cs.
We have also setup the redis server as a windows service on a windows machine using the below link: https://github.com/MicrosoftArchive/redis/releases
how can we proceed further. How and where(in which project) can we actually write the code to set the cache with the data from SQL table.
Hi,
We are using the latest version of ASPNETZERO and have created a website using the framework. The site takes more than 25seconds to load the login screen. Below is the performance graph and also the network traffic. We have not customized the login screen and using the default template.
This is very concerning, our application's performance needs to be almost instant. Please let me know what we should do to optimize the performance.
public site url: https://idmsvnext.infogroup.com
We are using the latest version on aspnetzero and are not using Signalr at all. In the developer tool we do observe that instances of signalr even at the login screen.
we want to ensure that the SignalR/Chat related code doesn't load/add overhead when it's not going to be used at all.
Can someone please share the steps to disable/remove Signalr completely.