public async Task <IActionResult> List([DataSourceRequest] DataSourceRequest request) { var entities = await _emailTemplateRepository.GetAllEmailTemplates(); var models = entities.Select(e => _mapper.Map <EmailTemplate, EmailTemplateViewModel>(e)).ToList(); var result = new DataSourceResult { Data = models, Total = models.Count }; return(Json(result)); }