Exemplo n.º 1
0
 internal void GetLinkedPosts()
 {
     using (var db = new DbAPIContext())
     {
         postsId = db.Posts.Where(p => p.UserId == Id).Select(p => p.Id).ToList();
     }
 }
Exemplo n.º 2
0
 internal void GetLinkedLikes()
 {
     using (var db = new DbAPIContext())
     {
         likesId = db.Likes.Where(l => l.UserId == Id).Select(l => l.Id).ToList();
     }
 }
Exemplo n.º 3
0
 internal void GetLinkedComments()
 {
     using (var db = new DbAPIContext())
     {
         commentsId = db.Comments.Where(c => c.UserId == Id).Select(c => c.Id).ToList();
     }
 }
Exemplo n.º 4
0
 internal void GetLinkedLikes()
 {
     using (var db = new DbAPIContext())
     {
         likes = db.Likes.Where(l => l.PostId == Id).ToList();
     }
 }
Exemplo n.º 5
0
 internal void GetLinkedComments()
 {
     using (var db = new DbAPIContext())
     {
         comments = db.Comments.Where(c => c.PostId == Id).ToList();
     }
 }
Exemplo n.º 6
0
 public void GetLinkedUsers()
 {
     using (var db = new DbAPIContext())
     {
         List <int> userIds = db.User_Groups.Where(ug => ug.GroupId == Id).Select(ug => ug.Id).ToList();
         users = db.Users.Where(u => userIds.Contains(u.Id)).ToList();
     }
 }
Exemplo n.º 7
0
 internal void GetLinkedGroups()
 {
     using (var db = new DbAPIContext())
     {
         List <int> groupsId = db.User_Groups.Where(ug => ug.UserId == Id).Select(ug => ug.UserId).ToList();
         groups = db.Groups.Where(g => groupsId.Any(gId => gId == g.Id)).ToList();
     }
 }
Exemplo n.º 8
0
 public void GetLinkedPosts()
 {
     using (var db = new DbAPIContext())
     {
         posts = db.Posts.Where(p => p.GroupId == Id).ToList();
         foreach (Post post in posts)
         {
             post.GetLinkedInformations();
         }
     }
 }
Exemplo n.º 9
0
        public static bool Authenticate(string id, string password)
        {
            if (id == null || password == null)
            {
                return(false);
            }

            using (var db = new DbAPIContext())
            {
                User user = db.Users.Find(int.Parse(id));
                if (user != null)
                {
                    return(user.Password == password);
                }
            }



            return(false);
        }
Exemplo n.º 10
0
        public static bool Authenticate(DbAPIContext context, int id, string password)
        {
            if (string.IsNullOrEmpty(password))
            {
                return(false);
            }

            User user = context.Users.Find(id);

            if (user == null)
            {
                return(false);
            }
            else if (user.Password != password)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Exemplo n.º 11
0
 public UsersController(DbAPIContext context)
 {
     this.context = context;
 }
Exemplo n.º 12
0
 public Repository(DbAPIContext db)
 {
     Db    = db;
     DbSet = db.Set <TEntity>();
 }
Exemplo n.º 13
0
 public EstoqueRepository(DbAPIContext context) : base(context)
 {
 }
 public InMemoryBookRepository(DbAPIContext context)
 {
     _context = context;
 }
Exemplo n.º 15
0
 public CommentsController(DbAPIContext context)
 {
     this.context = context;
 }
Exemplo n.º 16
0
 public SearchController(DbAPIContext context)
 {
     this.context = context;
 }
Exemplo n.º 17
0
 public FluxController(DbAPIContext context)
 {
     this.context = context;
 }
Exemplo n.º 18
0
 public ProdutoRepository(DbAPIContext context) : base(context)
 {
 }
Exemplo n.º 19
0
 public GroupsController(DbAPIContext context)
 {
     this.context = context;
 }
Exemplo n.º 20
0
 public LikesController(DbAPIContext context)
 {
     this.context = context;
 }
Exemplo n.º 21
0
 public LojaRepository(DbAPIContext context) : base(context)
 {
 }
Exemplo n.º 22
0
 public PostsController(DbAPIContext context)
 {
     this.context = context;
 }