Hi,
I am looking to store Entities in Cache instead of querying the database all the time and when an entity is CRUD these changes to be also replicated to Cache.
I read Caching in aspnetboilerplate documentation but it does not support the above requirement and it is also not storing Entitis but rather Dtos. Is there anything that support my requirements?
Thanks in advance
Hi,
We are looking to use a CI/CD service for our aspnetzero project (.net core & angular) Can anyone suggest any solutions that integrate seamlessly with .net core?
Thanks in advance
I have the following code and I am getting the following error when I call a method of the AppService1: MyProject.Application.Extended.Settings.AppService1' is waiting for the following dependencies:
public interface IGenericCache : ITransientDependency
{
}
public interface IGenericCache<TEntity, TModelDto, TPrimaryKey>
: IGenericCache where TEntity : class, IEntity<TPrimaryKey>
{
TModelDto Get(TPrimaryKey key);
IList<TModelDto> GetAll();
}
public class GenericCache<TEntity, TModelDto, TPrimaryKey> : IGenericCache<TEntity, TModelDto, TPrimaryKey>
where TEntity : class, IEntity<TPrimaryKey>
{
public readonly IList<TModelDto> CacheItemsAsList;
public readonly ConcurrentDictionary<TPrimaryKey, TModelDto> CacheItems;
//-------------------------------------------------------------------------------------
public GenericCache(IObjectMapper objectMapper,
IRepository<TEntity, TPrimaryKey> repo)
{
var tempList = new List<TModelDto>();
CacheItems = new ConcurrentDictionary<TPrimaryKey, TModelDto>();
IList<TEntity> dbEntities = repo.GetAllList();
if (dbEntities != null)
{
foreach (var dbEntity in dbEntities)
{
TModelDto mappedItem = objectMapper.Map<TModelDto>(dbEntity);
CacheItems.TryAdd(dbEntity.Id, mappedItem);
tempList.Add(mappedItem);
}
}
CacheItemsAsList = tempList;
}
//-------------------------------------------------------------------------------------
public IList<TModelDto> GetAll()
{
return CacheItemsAsList;
}
//-------------------------------------------------------------------------------------
public TModelDto Get(TPrimaryKey key)
{
CacheItems.TryGetValue(key, out TModelDto modelDto);
return modelDto;
}
}
public class AppService1 : KYCAppServiceBase
{
private readonly GenericCache<Country, CountryDto, int> genericCache;
//-----------------------------------------------------------------------------------------------------------------------
public AppService1(GenericCache<Country, CountryDto, int> genericCache)
{
this.genericCache = genericCache;
}
Can anyone help?
Thanks in advance
Hi,
Is there any full example using the EntityCache. The one in the documentation is not full as it contains only the signature of the cache and not how it is implemented (PersonCache).
Also why the PersonCache implemented ITransientDependency. I thought this must be singleton
Thanks in advance
Hi,
Does aspnet zero supports server side pagination?
Thanks in advance
I have followed the instructions here to debug abp code. However when I step into sometimes I cannot access variables becuase it says the code is optimised maybe impossible to debug. How can I overcome this?
I have noticed that nswag refresh script creates camelcase models on angular ts. On server I have the following model
public class Client
{
public string Name {get;set;}
public DateTime DateOfBirth {get;set;}
}
in angular I get the following
name!: string | undefined;
dateOfBirth!: string | undefined;
How do I force it to keep the same names?
Thanks
What is the difference between the AbpSession.ToUserIdentifier() vs UserManager.FindByIdAsync
?
Which one is best to use?
Thanks in advance
Hi I have created an extra xml file for localisation. This was done to help me when updating aspnetzero to latest version to avoid losing changes to MyProject.xml language file.
I named this MyProjectExtended.xml
However I dont know how the aspnetzero will read this.
How can it be done?
Thanks in advance
I have created a new project for some infrastructure code I have in my solution. I have a helper service there that needs to be singleton.
public class FileProvider : IFileProvider, ISingletonDependency
{
}
public interface IFileProviderProvider
{
string GetDataFilesPath();
}
However when I try to use this provider in another service initializing it from the constructror I get
Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service MyProject.Infrastructure.Helpers.IFileProvider was found
Does anyone know why am I getting this?