Ejemplo n.º 1
0
        public AlbumController()
        {
            var db = new ArtistsDbContext();

            this.albumData    = new EfGenericRepository <Album>(db);
            this.producerData = new EfGenericRepository <Producer>(db);
        }
Ejemplo n.º 2
0
        public ArtistController()
        {
            var db = new ArtistsDbContext();

            this.artistData  = new EfGenericRepository <Artist>(db);
            this.countryData = new EfGenericRepository <Country>(db);
        }
Ejemplo n.º 3
0
        static void Main()
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion <ArtistsDbContext, Configuration>());

            var db = new ArtistsDbContext();

            db.Artists.Count();
        }
Ejemplo n.º 4
0
        public SongController()
        {
            var db = new ArtistsDbContext();

            this.songData   = new EfGenericRepository <Song>(db);
            this.genreData  = new EfGenericRepository <Genre>(db);
            this.artistData = new EfGenericRepository <Artist>(db);
            this.albumData  = new EfGenericRepository <Album>(db);
        }
Ejemplo n.º 5
0
        public static void Main()
        {
            var db = new ArtistsDbContext();

            var artist = new Artist
            {
                Name   = "Pesho",
                Gender = GenderType.Female
            };

            db.Artists.Add(artist);

            db.SaveChanges();

            Console.WriteLine(db.Artists.Count());
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion <ArtistsDbContext, Configuration>());
            IArtistsDbContext db = new ArtistsDbContext();

            Artist artist = new Artist
            {
                Name   = "Madona",
                Gender = GenderType.Female
            };

            //db.Configuration.LazyLoadingEnabled = false;
            //db.Configuration.ValidateOnSaveEnabled = false;
            db.Artists.Add(artist);
            db.SaveChanges();

            //db.Configuration.LazyLoadingEnabled = true;
            //db.Configuration.ValidateOnSaveEnabled = true;

            Console.WriteLine(db.Artists.Count());
        }
Ejemplo n.º 7
0
 public ArtistDetailRepository(ArtistsDbContext context) : base(context)
 {
 }
Ejemplo n.º 8
0
 public UnitOfWork(ArtistsDbContext context)
 {
     _context      = context;
     ArtistDetails = new ArtistDetailRepository(_context);
     Artists       = new ArtistRepository(_context);
 }
Ejemplo n.º 9
0
        public GenreController()
        {
            var db = new ArtistsDbContext();

            this.genreData = new EfGenericRepository <Genre>(db);
        }
Ejemplo n.º 10
0
 public ArtistsController(ArtistsDbContext context)
 {
     _context = context;
 }
Ejemplo n.º 11
0
 public SqlServerArtistsDbService(ArtistsDbContext context)
 {
     _context = context;
 }
Ejemplo n.º 12
0
 public ArtistsContextDbService(ArtistsDbContext context)
 {
     _context = context;
 }