internal void GetLinkedPosts() { using (var db = new DbAPIContext()) { postsId = db.Posts.Where(p => p.UserId == Id).Select(p => p.Id).ToList(); } }
internal void GetLinkedLikes() { using (var db = new DbAPIContext()) { likesId = db.Likes.Where(l => l.UserId == Id).Select(l => l.Id).ToList(); } }
internal void GetLinkedComments() { using (var db = new DbAPIContext()) { commentsId = db.Comments.Where(c => c.UserId == Id).Select(c => c.Id).ToList(); } }
internal void GetLinkedLikes() { using (var db = new DbAPIContext()) { likes = db.Likes.Where(l => l.PostId == Id).ToList(); } }
internal void GetLinkedComments() { using (var db = new DbAPIContext()) { comments = db.Comments.Where(c => c.PostId == Id).ToList(); } }
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(); } }
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(); } }
public void GetLinkedPosts() { using (var db = new DbAPIContext()) { posts = db.Posts.Where(p => p.GroupId == Id).ToList(); foreach (Post post in posts) { post.GetLinkedInformations(); } } }
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); }
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); } }
public UsersController(DbAPIContext context) { this.context = context; }
public Repository(DbAPIContext db) { Db = db; DbSet = db.Set <TEntity>(); }
public EstoqueRepository(DbAPIContext context) : base(context) { }
public InMemoryBookRepository(DbAPIContext context) { _context = context; }
public CommentsController(DbAPIContext context) { this.context = context; }
public SearchController(DbAPIContext context) { this.context = context; }
public FluxController(DbAPIContext context) { this.context = context; }
public ProdutoRepository(DbAPIContext context) : base(context) { }
public GroupsController(DbAPIContext context) { this.context = context; }
public LikesController(DbAPIContext context) { this.context = context; }
public LojaRepository(DbAPIContext context) : base(context) { }
public PostsController(DbAPIContext context) { this.context = context; }