Example #1
0
        //private static Author GetAuthor(Author author)
        //{
        //    using (var context = new BookDBDataContext())
        //    {
        //        return context.Authors.FirstOrDefault(a => a.FirstName.Equals(author.FirstName) && a.LastName.Equals(author.LastName));
        //    }
        //}
        private static void AddGenre(string genre)
        {
            using (var context = new BookDBDataContext())
            {
                if (context.Genres.FirstOrDefault(g => g.Name.Equals(genre)) == null)
                {
                    Genre gen = new Genre()
                    {
                        Name = genre
                    };

                    context.Genres.InsertOnSubmit(gen);
                    context.SubmitChanges();
                }
            }
        }
Example #2
0
 partial void UpdateGenre(Genre instance);
Example #3
0
 partial void DeleteGenre(Genre instance);
Example #4
0
 partial void InsertGenre(Genre instance);