Beispiel #1
0
        public ActionResult Create(ArtworkFormViewModel artworkForm)
        {
            //[Bind(Include="Id,Title,Description,Price,Created,ImageUrl")]
            Artwork artwork = Mapper.Map <ArtworkFormViewModel, Artwork>(artworkForm);

            if (ModelState.IsValid)
            {
                _artworkService.CreateArtwork(artwork);
                _artworkService.SaveArtwork();
                return(RedirectToAction("Index"));
            }

            return(View(artwork));
        }
Beispiel #2
0
        //Saves artwork.
        public async Task SaveArtworkAsync(Artwork artwork)
        {
            await _artworkService.SaveArtwork(artwork);

            await UpdateArtworkListAsync();
        }