public Task <Post> GetPostById(int id) { return(AllPost.Where(p => p.Id == id).FirstOrDefaultAsync()); }
public Task <List <Post> > GetPostsByUserId(int userId) { return(AllPost.Where(p => p.Id == userId).ToListAsync()); }