Exemplo n.º 1
0
 public UsersController(IGetUsersCommand searchUsersCommand, IGetUserCommand getOneUserCommand, ICreateUserCommand createUserCommand, IEditUserCommand editUserCommand, IDeleteUserCommand deleteUserCommand, WebNewsContext context)
 {
     _searchUsersCommand = searchUsersCommand;
     _getOneUserCommand  = getOneUserCommand;
     _createUserCommand  = createUserCommand;
     _editUserCommand    = editUserCommand;
     _deleteUserCommand  = deleteUserCommand;
     _context            = context;
 }
Exemplo n.º 2
0
 public ArticlesController(IGetArticlesCommand searchArticlesCommand, IGetArticleCommand getOneArticleCommand, ICreateArticleCommand createArticleCommand, IEditArticleCommand editArticleCommand, IDeleteArticleCommand deleteArticleCommand, WebNewsContext context)
 {
     _searchArticlesCommand = searchArticlesCommand;
     _getOneArticleCommand  = getOneArticleCommand;
     _createArticleCommand  = createArticleCommand;
     _editArticleCommand    = editArticleCommand;
     _deleteArticleCommand  = deleteArticleCommand;
     _context = context;
 }
Exemplo n.º 3
0
 public CommentsController(IGetCommentsCommand searchCommentsCommand, IGetCommentCommand getOneCommentCommand, ICreateCommentCommand createCommentCommand, IEditCommentCommand editCommentCommand, IDeleteCommentCommand deleteCommentCommand, WebNewsContext context)
 {
     _searchCommentsCommand = searchCommentsCommand;
     _getOneCommentCommand  = getOneCommentCommand;
     _createCommentCommand  = createCommentCommand;
     _editCommentCommand    = editCommentCommand;
     _deleteCommentCommand  = deleteCommentCommand;
     _context = context;
 }
 public EfEditCategoryCommand(WebNewsContext context) : base(context)
 {
 }
Exemplo n.º 5
0
 public EfGetCommentCommand(WebNewsContext context) : base(context)
 {
 }
Exemplo n.º 6
0
 public EfGetCategoriesCommand(WebNewsContext context) : base(context)
 {
 }
 public EfDeleteCommentCommand(WebNewsContext context) : base(context)
 {
 }
Exemplo n.º 8
0
 public EfEditArticleCommand(WebNewsContext context) : base(context)
 {
 }
Exemplo n.º 9
0
 public EfGetRoleCommand(WebNewsContext context) : base(context)
 {
 }
Exemplo n.º 10
0
 public EfCreateUserCommand(WebNewsContext context) : base(context)
 {
 }
Exemplo n.º 11
0
 public NewsTopView(WebNewsContext context)
 {
     _context = context;
 }
Exemplo n.º 12
0
        static void Main(string[] args)
        {
            var context = new WebNewsContext();

            context.Roles.Add(new Domain.Role
            {
                Name = "Admin"
            });
            context.Roles.Add(new Domain.Role
            {
                Name = "Reader"
            });

            context.SaveChanges();

            context.Users.Add(new Domain.User
            {
                FirstName = "Jovan",
                LastName  = "Rankovic",
                Email     = "*****@*****.**",
                Password  = "******",
                RoleId    = 1
            });
            context.Users.Add(new Domain.User
            {
                FirstName = "Luka",
                LastName  = "Lukic",
                Email     = "*****@*****.**",
                Password  = "******",
                RoleId    = 1
            });
            context.Users.Add(new Domain.User
            {
                FirstName = "Pera",
                LastName  = "Peric",
                Email     = "*****@*****.**",
                Password  = "******",
                RoleId    = 2
            });

            context.Categories.Add(new Domain.Category
            {
                Name = "Technology"
            });
            context.Categories.Add(new Domain.Category
            {
                Name = "Science"
            });
            context.Categories.Add(new Domain.Category
            {
                Name = "Lifestyle"
            });

            context.Hashtags.Add(new Domain.Hashtag
            {
                Tag = "#programming"
            });
            context.Hashtags.Add(new Domain.Hashtag
            {
                Tag = "#space"
            });
            context.Hashtags.Add(new Domain.Hashtag
            {
                Tag = "#nature"
            });

            context.SaveChanges();

            context.Articles.Add(new Domain.Article
            {
                Title     = "How to stay calm during exams",
                Content   = "Eos impedit copiosae te, dolor incorrupte definitionem ex eam. Te vel aeque laboramus scribentur, cu omnes feugait conceptam eam, vis nusquam commune et. Vis modus graeci ne, duo copiosae scaevola euripidis te. Ex his vocibus mentitum accusamus. Ad bonorum gubergren adversarium his, his prima mnesarchum honestatis an. Esse tantas sea.",
                ImagePath = "img/article/ls.jpg",
                UserId    = 1
            });
            context.Articles.Add(new Domain.Article
            {
                Title     = "Rocket launched today",
                Content   = "Eos impedit copiosae te, dolor incorrupte definitionem ex eam. Te vel aeque laboramus scribentur, cu omnes feugait conceptam eam, vis nusquam commune et. Vis modus graeci ne, duo copiosae scaevola euripidis te. Ex his vocibus mentitum accusamus. Ad bonorum gubergren adversarium his, his prima mnesarchum honestatis an. Esse tantas sea.",
                ImagePath = "img/article/sci.jpg",
                UserId    = 2
            });
            context.Articles.Add(new Domain.Article
            {
                Title     = "New chip series released",
                Content   = "Eos impedit copiosae te, dolor incorrupte definitionem ex eam. Te vel aeque laboramus scribentur, cu omnes feugait conceptam eam, vis nusquam commune et. Vis modus graeci ne, duo copiosae scaevola euripidis te. Ex his vocibus mentitum accusamus. Ad bonorum gubergren adversarium his, his prima mnesarchum honestatis an. Esse tantas sea.",
                ImagePath = "img/article/tech.jpg",
                UserId    = 1
            });

            context.SaveChanges();

            context.Comments.Add(new Domain.Comment
            {
                Text      = "Great article.",
                ArticleId = 3,
                UserId    = 3
            });
            context.Comments.Add(new Domain.Comment
            {
                Text      = "Thank you.",
                ArticleId = 3,
                UserId    = 1
            });
            context.Comments.Add(new Domain.Comment
            {
                Text      = "This is very interesting.",
                ArticleId = 2,
                UserId    = 3,
                UpdatedAt = System.DateTime.Now.AddMinutes(1)
            });

            context.ArticleCategory.Add(new Domain.ArticleCategory
            {
                ArticleId  = 3,
                CategoryId = 1
            });
            context.ArticleCategory.Add(new Domain.ArticleCategory
            {
                ArticleId  = 2,
                CategoryId = 2
            });
            context.ArticleCategory.Add(new Domain.ArticleCategory
            {
                ArticleId  = 1,
                CategoryId = 3
            });
            context.ArticleCategory.Add(new Domain.ArticleCategory
            {
                ArticleId  = 3,
                CategoryId = 2
            });

            context.ArticleHashtag.Add(new Domain.ArticleHashtag
            {
                ArticleId = 3,
                HashtagId = 1
            });
            context.ArticleHashtag.Add(new Domain.ArticleHashtag
            {
                ArticleId = 2,
                HashtagId = 2
            });
            context.ArticleHashtag.Add(new Domain.ArticleHashtag
            {
                ArticleId = 2,
                HashtagId = 1
            });
            context.ArticleHashtag.Add(new Domain.ArticleHashtag
            {
                ArticleId = 1,
                HashtagId = 3
            });

            context.SaveChanges();
        }
Exemplo n.º 13
0
 public ShowCommentNews(WebNewsContext context)
 {
     _context = context;
 }
Exemplo n.º 14
0
 public EfEditUserCommand(WebNewsContext context) : base(context)
 {
 }
Exemplo n.º 15
0
 public ShowGroupForAdd(WebNewsContext context)
 {
     _context = context;
 }
Exemplo n.º 16
0
 public EfGetArticlesCommand(WebNewsContext context) : base(context)
 {
 }
Exemplo n.º 17
0
 protected BaseEfCommand(WebNewsContext context)
 => Context = context;
Exemplo n.º 18
0
 public GroupShow(WebNewsContext context)
 {
     _context = context;
 }
Exemplo n.º 19
0
 public CommentController(WebNewsContext context)
 {
     _context = context;
 }
Exemplo n.º 20
0
 public HomeController(WebNewsContext context)
 {
     _context = context;
 }
Exemplo n.º 21
0
 public EfEditHashtagCommand(WebNewsContext context) : base(context)
 {
 }
Exemplo n.º 22
0
 public GroupController(WebNewsContext context)
 {
     _context = context;
 }
Exemplo n.º 23
0
 public EfCreateRoleCommand(WebNewsContext context) : base(context)
 {
 }
 public EfCreateArticleCommand(WebNewsContext context, IEmailSender emailSender) : base(context)
     => _emailSender = emailSender;
Exemplo n.º 25
0
 public EfCreateCategoryCommand(WebNewsContext context) : base(context)
 {
 }
 public EfDeleteArticleCommand(WebNewsContext context) : base(context)
 {
 }
Exemplo n.º 27
0
 public EfGetUsersCommand(WebNewsContext context) : base(context)
 {
 }
Exemplo n.º 28
0
 public EfGetHashtagsCommand(WebNewsContext context) : base(context)
 {
 }
 public EfDeleteHashtagCommand(WebNewsContext context) : base(context)
 {
 }
Exemplo n.º 30
0
 public EfDeleteUserCommand(WebNewsContext context)
     : base(context)
 {
 }