コード例 #1
0
        public async Task <IActionResult> create(Partitura partitura)
        {
            try{
                await _svc.create(partitura);

                return(Ok());
            }catch (ApplicationException aEx) {
                return(BadRequest(aEx.Message));
            }
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("Id,Title,ReleaseDate,Genre,Time,Price")] Partitura partitura)
        {
            try
            {
                await _svc.create(partitura);

                return(RedirectToAction(nameof(Index)));
            }
            catch (ApplicationException aEx)
            {
                ViewBag.Error = aEx.Message;
                return(View());
            }
        }