Exemplo n.º 1
0
 public UserController(UserManager <ApplicationUser> userManager,
                       IUserRateRepository userRateRep,
                       IMovieRepository movieRep,
                       IHostingEnvironment hostingEnv)
 {
     this.userManager = userManager;
     this.userRateRep = userRateRep;
     this.movieRep    = movieRep;
     this.hostingEnv  = hostingEnv;
 }
Exemplo n.º 2
0
        public static async Task <IEnumerable <UserRate> > GetUserRatesAsync(this ClaimsPrincipal user, IUserRateRepository userRateRep)
        {
            if (user.Identity.IsAuthenticated)
            {
                var userId = user.GetUserId();

                if (userId <= 0)
                {
                    return(null);
                }

                return(await userRateRep.GetUserRatesByUser(userId).ToListAsync());
            }
            return(null);
        }
Exemplo n.º 3
0
 public MovieController(IMovieRepository movieRep, IGenreRepository genreRep, IUserRateRepository userRateRep)
 {
     this.movieRep    = movieRep;
     this.genreRep    = genreRep;
     this.userRateRep = userRateRep;
 }
Exemplo n.º 4
0
 public UserRateController(IUserRateRepository userRateRep, IMovieRepository movieRep, UserManager <ApplicationUser> userManager)
 {
     this.userRateRep = userRateRep;
     this.movieRep    = movieRep;
     this.userManager = userManager;
 }