コード例 #1
0
ファイル: CommentController.cs プロジェクト: aenen/Cinema
 public CommentController(CommentRepository commentRepository, CommentTypeRepository commentTypeRepository, DbContext context, MovieRepository movieRepository, CinemaRepository cinemaRepository)
 {
     this.commentRepository     = commentRepository;
     this.commentTypeRepository = commentTypeRepository;
     this.movieRepository       = movieRepository;
     this.cinemaRepository      = cinemaRepository;
     this.context = context;
     userMgr      = new ApplicationUserManager(new UserStore <ApplicationUser>(context));
 }
コード例 #2
0
        public static CommentTypeCollection GetAll()
        {
            var repository = new CommentTypeRepository();
            var collection = new CommentTypeCollection();

            var colletionDTO = repository.FetchAll(new CommentTypeCriteria());

            foreach (DTO.CommentTypeDTO dto in colletionDTO)
            {
                var taskStatus = CommentType.CopyFromDTO(dto);
                taskStatus.MarkOld();
                collection.Add(taskStatus);
            }

            return(collection);
        }