| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using AutoMapper; |
| | | using CommonToolsCore; |
| | | using DTO; |
| | | using IServices; |
| | | using Microsoft.AspNetCore.Mvc.Rendering; |
| | |
| | | } |
| | | |
| | | _context.SaveChanges(); |
| | | resultEntity.ReturnID = intentionCustomer.Id; |
| | | |
| | | var listPosition = _context.IntentionCustomers.Where(r => r.RecStatus == "A").ToList(); |
| | | |
| | | var intentionCustomerDTOs = _mapper.Map<List<IntentionCustomerDTO>>(listPosition); |
| | | CacheHelperNetCore.CacheInsert("intentionCustomerDTOs", intentionCustomerDTOs); |
| | | |
| | | resultEntity.ReturnID = intentionCustomer.Id; |
| | | resultEntity.Result = true; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | /// <returns></returns> |
| | | public List<IntentionCustomerDTO> GetList() |
| | | { |
| | | |
| | | List<IntentionCustomerDTO> intentionCustomerDTOs = (List<IntentionCustomerDTO>)CacheHelperNetCore.CacheValue("intentionCustomerDTOs"); |
| | | if (intentionCustomerDTOs != null && intentionCustomerDTOs.Count > 0) |
| | | { |
| | | return intentionCustomerDTOs; |
| | | } |
| | | |
| | | var listPosition = _context.IntentionCustomers.Where(r => r.RecStatus == "A").ToList(); |
| | | |
| | | intentionCustomerDTOs = _mapper.Map<List<IntentionCustomerDTO>>(listPosition); |
| | | CacheHelperNetCore.CacheInsert("intentionCustomerDTOs", intentionCustomerDTOs); |
| | | |
| | | var list = _mapper.Map<List<IntentionCustomerDTO>>(listPosition); |
| | | return list; |
| | | } |