/// <summary> /// Create a new entry for artist in the data store /// </summary> /// <param name="entity"></param> public void Add(Artist entity) { var mongoServer = MongoServer; using (mongoServer){ entity.Id = Guid.NewGuid(); var mongoCollection = mongoServer.GetCollection<Artist>(); mongoCollection.Save(entity); } }
public void Add_Make_sure_It_Is_Working() { ArtistRepository artistRepository = new ArtistRepository(new ConfigurationProvider()); Artist artist = new Artist { Albums = new System.Collections.Generic.List<Album>{ new Album{ Title="Reasonable dought" , Tracks= new System.Collections.Generic.List<Track>{ new Track{ Number=1, title="Dead president" } }, YearReleased=1996 }, } }; artistRepository.Add(artist); Assert.That(artist.Id,Is.Not.Null); }
public void Update(Artist entity) { throw new NotImplementedException(); }