Beispiel #1
0
        /// <summary>
        /// Get by Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns>Category view model</returns>
        // GET api/values/5
        public async Task <CMSConfigurationViewModel> GetById(byte id)
        {
            var list = this.RequestContext.RouteData.Values.Keys;
            var para = APIProvider.APIGeneratorParameter(list, id);

            var source = await _config.SingleQuery(para);

            CMSConfigurationViewModel dest = Mapper.Map <CMSConfigurationViewModel>(source);

            if (dest == null)
            {
                dest = new CMSConfigurationViewModel();
            }
            return(dest);
        }
Beispiel #2
0
        public async Task <bool> Transaction(CMSConfigurationViewModel model, char action)
        {
            var obj = Mapper.Map <Domain.Models.CMS.CMSConfiguration>(model);

            return(await _config.Transaction(obj, action));
        }