コード例 #1
0
        public async Task <JsonResult> CreateNewLanguage(AddCultureRequest vm)
        {
            try
            {
                bool result = await _dataService.AddCultureAsync(vm.Culture, vm.Description);

                if (result)
                {
                    _cacheService.Invalidate(CacheKeys.Languages);
                    return(Json(new GenericResponse(true, AppResources.LanguageCreatedSuccessfully)));
                }

                return(Json(new GenericResponse(false, AppResources.LanguageCreationFailed)));
            }
            catch (Exception ex)
            {
                Trace.TraceError(ex.ToString());
                return(Json(new GenericResponse(false, ex.ToString())));
            }
        }
コード例 #2
0
 public JsonResult DeleteLanguage(AddCultureRequest vm)
 {
     return(Json(new GenericResponse(false, "This feature is not supported")));
 }