// GET api/artists/5
        public ArtistModel Get(int id)
        {
            var artistEntity = this.artistsRepository.Get(id);

            var artistModel = new ArtistModel()
            {
                ArtistId = artistEntity.ArtistId,
                Name = artistEntity.Name,
                Country = artistEntity.Country,
                DateOfBirth = artistEntity.DateOfBirth
            };

            return artistModel;
        }
        public IHttpActionResult Create(ArtistModel artist)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            var newArtist = new Artist
            {
                Name = artist.Name,
                Country = artist.Country,
                DateOfBirth = artist.DateOfBirth
            };

            this.Data.Artists.Add(newArtist);
            this.Data.SaveChanges();

            artist.Id = newArtist.Id;
            return Ok(artist);
        }
        public IHttpActionResult Update(int id, ArtistModel artist)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            var existingArtist = this.Data.Artists
                .All()
                .FirstOrDefault(a => a.Id == id);

            if (existingArtist == null)
            {
                return BadRequest("There is no artist with such id!");
            }

            existingArtist.Name = artist.Name;
            existingArtist.Country = artist.Country;
            existingArtist.DateOfBirth = artist.DateOfBirth;
            this.Data.SaveChanges();

            artist.Id = id;
            return Ok(artist);
        }
 public ActionResult CreateArtist(ArtistModel model)
 {
     _facade = new DataAccessLayerfacade();
     _facade.GetArtistRep().CreateArtist(new Artist { name = model.Name });
     return RedirectToAction("Index");
 }