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(); } }
public HttpResponseMessage Post(NewBandBindingModel newBand) { _bandRepository.AddBand(newBand); return(Request.CreateResponse(HttpStatusCode.OK)); }