Ejemplo n.º 1
0
        protected override void Seed(MovieRatingContext context)
        {
            //  create genres
            context.GenreSet.AddOrUpdate(g => g.Name, GenerateGenres());

            // create movies
            context.MovieSet.AddOrUpdate(m => m.Title, GenerateMovies());

            //// create stocks
            context.StockSet.AddOrUpdate(GenerateStocks());

            // create customers
            context.CustomerSet.AddOrUpdate(GenerateCustomers());

            // create roles
            context.RoleSet.AddOrUpdate(r => r.Name, GenerateRoles());

            // username: chsakell, password: homecinema
            context.UserSet.AddOrUpdate(u => u.Email, new User[] {
                new User()
                {
                    Email          = "*****@*****.**",
                    UserName       = "******",
                    HashedPassword = "******",
                    Salt           = "mNKLRbEFCH8y1xIyTXP4qA==",
                    IsLocked       = false,
                    DateCreated    = DateTime.Now
                }
            });

            // // create user-admin for chsakell
            context.UserRoleSet.AddOrUpdate(new UserRole[] {
                new UserRole()
                {
                    RoleId = 1, // admin
                    UserId = 1  // chsakell
                }
            });
        }
Ejemplo n.º 2
0
 public MovieRatingsController(MovieRatingContext context, IContextService contextService)
 {
     _context        = context;
     _contextService = contextService;
 }
 public ReviewerController(MovieRatingContext context)
 {
     _context = context;
 }
Ejemplo n.º 4
0
 public MovieRatingContext Init()
 {
     return(dbContext ?? (dbContext = new MovieRatingContext()));
 }
Ejemplo n.º 5
0
 public MovieController(MovieRatingContext context)
 {
     _context = context;
 }
Ejemplo n.º 6
0
 public RegisterUserController(MovieRatingContext context, UserManager <UserDetails> userManager, SignInManager <UserDetails> signinManager)
 {
     _context       = context;
     _userManager   = userManager;
     _signinManager = signinManager;
 }
Ejemplo n.º 7
0
 public UserDetailsController(MovieRatingContext context, SignInManager <UserDetails> signinManager)
 {
     _context       = context;
     _signinManager = signinManager;
 }
 public MovieRatingsListViewComponent(MovieRatingContext _context, IContextService contextService)
 {
     context         = _context;
     _contextService = contextService;
 }