/// <summary>
        ///
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public List <MerchantImageModel> GetMerchantImages()
        {
            var items = MerchantImageRepository.GetAll();

            if (items != null)
            {
                return(items.Select(p => p.ToModel()).ToList());
            }
            return(new List <MerchantImageModel>());
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public DatatablesView <MerchantImageModel> GetMerchantImagesByPaging(DataTablesPaging request)
        {
            int total       = 0;
            var pagingItems = MerchantImageRepository.GetItemsByPaging(request, out total);
            var items       = new List <MerchantImageModel>();

            foreach (var pagingItem in pagingItems)
            {
                var item = pagingItem.ToModel();
                items.Add(item);
            }
            return(new DatatablesView <MerchantImageModel>(request.Draw, total, pagingItems.Count, items));
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool Save(MerchantImageModel model)
 {
     return(MerchantImageRepository.Save(model.ToPO()));
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public MerchantImageModel GetMerchantImage(int id)
        {
            var item = MerchantImageRepository.GetItem(id);

            return(item.ToModel());
        }