Exemplo n.º 1
0
        public void AddBand(NewBandBindingModel newBand)
        {
            using (var context = new MusicArchiveContext())
            {
                var band = new Band
                {
                    Name           = newBand.Name,
                    CountryOfOrgin = newBand.CountryOfOrigin,
                    Genre          = newBand.Genre,
                    FormedIn       = newBand.YearOfFormation,
                    LyricalThemes  = JoinTags(newBand.LyricalThemes)
                };

                context.Bands.Add(band);
                context.SaveChanges();
            }
        }
Exemplo n.º 2
0
 public HttpResponseMessage Post(NewBandBindingModel newBand)
 {
     _bandRepository.AddBand(newBand);
     return(Request.CreateResponse(HttpStatusCode.OK));
 }