예제 #1
0
        public Domain.Entities.GlobalSetting.ContactInformation GetTypeAddress(int typeAddress, bool isCache = true)
        {
            Domain.Entities.GlobalSetting.ContactInformation contactInformation;

            if (isCache)
            {
                var sbKey = new StringBuilder();
                sbKey.AppendFormat(CacheKey, "GetTypeAddress");
                sbKey.Append(typeAddress);

                var key = sbKey.ToString();
                contactInformation = _cacheManager.Get <Domain.Entities.GlobalSetting.ContactInformation>(key);
                if (contactInformation == null)
                {
                    contactInformation = _contactInfoRepository.Get(x => x.Status == 1 && x.Type == typeAddress, true);
                    _cacheManager.Put(key, contactInformation);
                }
            }
            else
            {
                contactInformation = _contactInfoRepository.GetById(typeAddress);
            }


            return(contactInformation);
        }
        public HttpResponseMessage Get(int id)
        {
            var contactInfos             = _contactInfoRepository.Get(id);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contactInfos);

            return(response);
        }
예제 #3
0
 public ContactInfo Get(long id)
 {
     return(_contactInfoRepository.Get(id));
 }