public async Task <DataRespone <string> > Add(AddArtistDTO artistDTO)
        {
            bool result = await _artistService.AddArtist(artistDTO);

            if (result)
            {
                return new DataRespone <string>()
                       {
                           Ok = true, data = "The new artist has added.", error = ""
                       }
            }
            ;
            return(new DataRespone <string>()
            {
                Ok = false, data = "Something went wrong.", error = "Adding an Artist was not success."
            });
        }
Ejemplo n.º 2
0
        public Artist AddArtist(Artist newArtist)
        {
            Ensure.That(newArtist, () => newArtist).IsNotNull();

            newArtist = AddSkyhookData(newArtist);
            newArtist = SetPropertiesAndValidate(newArtist);

            _logger.Info("Adding Artist {0} Path: [{1}]", newArtist, newArtist.Path);

            // add metadata
            _artistMetadataService.Upsert(newArtist.Metadata.Value);
            newArtist.ArtistMetadataId = newArtist.Metadata.Value.Id;

            // add the artist itself
            _artistService.AddArtist(newArtist);

            return(newArtist);
        }
Ejemplo n.º 3
0
        public IActionResult Create(CreateArtistViewModel model)
        {
            Boolean success = _artistService.AddArtist(_mapper.Map <MusicCore.Artist>(model.artist));

            return(RedirectToAction("Artists"));
        }
Ejemplo n.º 4
0
 public int Post(CreateArtistRequest artist, CancellationToken ct)
 {
     return(_artistService.AddArtist(artist, ct));
 }