async Task <bool> SetNpmOptions(string id, Language lan, CodeGenNpmOptionsModel value) { var key = CodeGenControllerKeys.NpmOptions + Enum.GetName(typeof(Language), lan) + ":" + id; var cacheResult = JsonConvert.SerializeObject(value); var result = await redis.SetAsync(key, cacheResult, null); return(result); }
public async Task <ApiResult <bool> > NpmOptions(string id, Language language, [FromBody] CodeGenNpmOptionsModel value) { if (!ModelState.IsValid) { return(new ApiResult <bool>(l, BasicControllerEnums.UnprocessableEntity, ModelErrors())); } var result = await SetNpmOptions(id, language, value); return(new ApiResult <bool>(result)); }