diff --git a/products/ASC.CRM/Server/ApiModels/ResponsesDto/ContactInfoDto.cs b/products/ASC.CRM/Server/ApiModels/ResponsesDto/ContactInfoDto.cs index 339a78bd6b..85f3261a9a 100644 --- a/products/ASC.CRM/Server/ApiModels/ResponsesDto/ContactInfoDto.cs +++ b/products/ASC.CRM/Server/ApiModels/ResponsesDto/ContactInfoDto.cs @@ -136,11 +136,6 @@ namespace ASC.CRM.ApiModels Data = "support@onlyoffice.com", InfoType = ContactInfoType.Email }; - } - - public void Mapping(Profile profile) - { - profile.CreateMap(); - } + } } } \ No newline at end of file diff --git a/products/ASC.CRM/Server/Core/Dao/CasesDao.cs b/products/ASC.CRM/Server/Core/Dao/CasesDao.cs index fbf5a4448a..a01e0f6aee 100644 --- a/products/ASC.CRM/Server/Core/Dao/CasesDao.cs +++ b/products/ASC.CRM/Server/Core/Dao/CasesDao.cs @@ -390,7 +390,7 @@ namespace ASC.CRM.Core.Dao if (result > 0) { - _cache.Insert(cacheKey, result, TimeSpan.FromSeconds(30)); + _cache.Insert(cacheKey, result.ToString(), TimeSpan.FromSeconds(30)); } return result; diff --git a/products/ASC.CRM/Server/Core/Dao/ContactDao.cs b/products/ASC.CRM/Server/Core/Dao/ContactDao.cs index 748b4a4e35..1d17e7f340 100644 --- a/products/ASC.CRM/Server/Core/Dao/ContactDao.cs +++ b/products/ASC.CRM/Server/Core/Dao/ContactDao.cs @@ -326,7 +326,7 @@ namespace ASC.CRM.Core.Dao } if (result > 0) { - _cache.Insert(cacheKey, result, TimeSpan.FromMinutes(1)); + _cache.Insert(cacheKey, result.ToString(), TimeSpan.FromMinutes(1)); } return result; diff --git a/products/ASC.CRM/Server/Core/Dao/DealDao.cs b/products/ASC.CRM/Server/Core/Dao/DealDao.cs index f6c3be1999..f534d25f78 100644 --- a/products/ASC.CRM/Server/Core/Dao/DealDao.cs +++ b/products/ASC.CRM/Server/Core/Dao/DealDao.cs @@ -544,7 +544,7 @@ namespace ASC.CRM.Core.Dao } if (result > 0) { - _cache.Insert(cacheKey, result, TimeSpan.FromSeconds(30)); + _cache.Insert(cacheKey, result.ToString(), TimeSpan.FromSeconds(30)); } return result; diff --git a/products/ASC.CRM/Server/Core/Dao/InvoiceDao.cs b/products/ASC.CRM/Server/Core/Dao/InvoiceDao.cs index e054367fdf..5b6a4c13bb 100644 --- a/products/ASC.CRM/Server/Core/Dao/InvoiceDao.cs +++ b/products/ASC.CRM/Server/Core/Dao/InvoiceDao.cs @@ -397,7 +397,7 @@ namespace ASC.CRM.Core.Dao if (result > 0) { - _cache.Insert(cacheKey, result, TimeSpan.FromSeconds(30)); + _cache.Insert(cacheKey, result.ToString(), TimeSpan.FromSeconds(30)); } return result; } diff --git a/products/ASC.CRM/Server/Core/Dao/InvoiceItemDao.cs b/products/ASC.CRM/Server/Core/Dao/InvoiceItemDao.cs index ebaa033dca..9e3e7b93bb 100644 --- a/products/ASC.CRM/Server/Core/Dao/InvoiceItemDao.cs +++ b/products/ASC.CRM/Server/Core/Dao/InvoiceItemDao.cs @@ -232,7 +232,7 @@ namespace ASC.CRM.Core.Dao if (result > 0) { - _cache.Insert(cacheKey, result, TimeSpan.FromSeconds(30)); + _cache.Insert(cacheKey, result.ToString(), TimeSpan.FromSeconds(30)); } return result; } diff --git a/products/ASC.CRM/Server/Core/Dao/TaskDao.cs b/products/ASC.CRM/Server/Core/Dao/TaskDao.cs index f156ee121b..dc3b704823 100644 --- a/products/ASC.CRM/Server/Core/Dao/TaskDao.cs +++ b/products/ASC.CRM/Server/Core/Dao/TaskDao.cs @@ -512,7 +512,7 @@ namespace ASC.CRM.Core.Dao if (result > 0) { - _cache.Insert(cacheKey, result, TimeSpan.FromMinutes(1)); + _cache.Insert(cacheKey, result.ToString(), TimeSpan.FromMinutes(1)); } return result; diff --git a/products/ASC.CRM/Server/Core/Entities/ContactInfo.cs b/products/ASC.CRM/Server/Core/Entities/ContactInfo.cs index 9e20e630d5..ddcb50f367 100644 --- a/products/ASC.CRM/Server/Core/Entities/ContactInfo.cs +++ b/products/ASC.CRM/Server/Core/Entities/ContactInfo.cs @@ -27,10 +27,13 @@ using System; using ASC.Common.Mapping; +using ASC.CRM.ApiModels; using ASC.CRM.Classes; using ASC.CRM.Core.EF; using ASC.CRM.Core.Enums; +using AutoMapper; + namespace ASC.CRM.Core { public class ContactInfo : DomainObject, IMapFrom @@ -78,5 +81,12 @@ namespace ASC.CRM.Core return typeof(ContactInfoBaseCategory); } } + + public void Mapping(Profile profile) + { + profile.CreateMap() + .ForMember(x => x.InfoType, opt => opt.MapFrom(x => x.Type)); + + } } } \ No newline at end of file