コード例 #1
0
        public async Task <ActionResult> UploadFont(UploadFontViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View("_UploadFont", model));
            }

            var fontFilePath = SaveFont(model.AttachedFont);

            await _fontService.CreateAsync(model.FontName, model.FontType, fontFilePath);

            return(Content("Refresh"));
        }
コード例 #2
0
        public ActionResult UploadFont(UploadFontViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View("_UploadFont", model));
            }

            var fontFilePath = SaveFont(model.AttachedFont, nameof(UploadFont));

            var fontId = _fontService.Create(model.FontName, model.FontType, fontFilePath);

            return(this.Content("Refresh"));
        }
コード例 #3
0
        public ActionResult UploadFont()
        {
            var model = new UploadFontViewModel();

            return(PartialView("_UploadFont", model));
        }