Example #1
0
        public TypeCache(ICacheBuilder cacheBuilder)
        {
            var cacheDataEntities = cacheBuilder.BuildTypeCache <T, T2>();

            cacheData = cacheDataEntities.Values.Select(i => new VmType()
            {
                Id = i.Id, Code = i.Code, OrderNumber = i.OrderNumber, Names = i.Names.Select(j => new VmTypeName()
                {
                    Name = j.Name, LocalizationId = j.LocalizationId
                }).ToList()
            }).ToDictionary(i => i.Code.ToLower(), i => i);
            reverseCache = cacheData.ToDictionary(i => i.Value.Id, i => i.Value);
        }