crm: fixed bug with crash app for contacts list more than 25 and fixed bug with always infoType set 0

This commit is contained in:
Alexey Bannov 2021-07-16 19:01:57 +03:00
parent 1268a436ca
commit 923db85ca1
8 changed files with 17 additions and 12 deletions

View File

@ -136,11 +136,6 @@ namespace ASC.CRM.ApiModels
Data = "support@onlyoffice.com",
InfoType = ContactInfoType.Email
};
}
public void Mapping(Profile profile)
{
profile.CreateMap<ContactInfo, ContactInfoDto>();
}
}
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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<DbContactInfo>
@ -78,5 +81,12 @@ namespace ASC.CRM.Core
return typeof(ContactInfoBaseCategory);
}
}
public void Mapping(Profile profile)
{
profile.CreateMap<DbContactInfo, ContactInfo>()
.ForMember(x => x.InfoType, opt => opt.MapFrom(x => x.Type));
}
}
}