当前位置: 首页>>代码示例>>C#>>正文


C# MongoRepository.Find方法代码示例

本文整理汇总了C#中MongoRepository.Find方法的典型用法代码示例。如果您正苦于以下问题:C# MongoRepository.Find方法的具体用法?C# MongoRepository.Find怎么用?C# MongoRepository.Find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MongoRepository的用法示例。


在下文中一共展示了MongoRepository.Find方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getAllFacebookFeedsByUserIdAndProfileId

        public string getAllFacebookFeedsByUserIdAndProfileId(string UserId, string ProfileId)
        {
             //List<Domain.Socioboard.Domain.FacebookFeed> lstFacebookFeed=new List<Domain.Socioboard.Domain.FacebookFeed> ();
            //try
            //{
            //    if (objFacebookFeedRepository.checkFacebookUserExists(ProfileId, Guid.Parse(UserId)))
            //    {
            //        lstFacebookFeed = objFacebookFeedRepository.getAllFacebookFeeds(Guid.Parse(UserId), ProfileId);
            //    }
            //    else
            //    {
            //         lstFacebookFeed = objFacebookFeedRepository.getAllFacebookUserFeeds(ProfileId);
            //    }
            //    return new JavaScriptSerializer().Serialize(lstFacebookFeed);
            //}
            //catch (Exception ex)
            //{
            //    Console.WriteLine(ex.StackTrace);
            //    return "Something Went Wrong";
            //}

            MongoRepository boardrepo = new MongoRepository("MongoFacebookFeed");
            try
            {

                var result = boardrepo.Find<MongoFacebookFeed>(t => t.UserId.Equals(UserId)&&t.ProfileId.Equals(ProfileId)).ConfigureAwait(false);

                var task = Task.Run(async () =>
                {
                    return await result;
                });
                IList<MongoFacebookFeed> objfbfeeds = task.Result;
                if (objfbfeeds.Count() == 0)
                {

                    result = boardrepo.Find<MongoFacebookFeed>(x => x.ProfileId.Equals(ProfileId)).ConfigureAwait(false);

                    task = Task.Run(async () =>
                    {
                        return await result;
                    });
                }
                return new JavaScriptSerializer().Serialize(objfbfeeds);

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return "Something Went Wrong";
            }
        }
开发者ID:socioboard,项目名称:socioboard-core,代码行数:51,代码来源:FacebookFeed.asmx.cs

示例2: TestGetById

        public void TestGetById()
        {
            var repo = new MongoRepository<Team>(_db);
            var team = new Team()
            {
                Name = "Tom"
            };
            repo.Save(team);
            var id = team.Id;

            var teamRefresh = repo.Find(id);

            Assert.AreEqual(teamRefresh.Name, "Tom");
        }
开发者ID:etiennefab4,项目名称:PetanqueMVC,代码行数:14,代码来源:TestMongoDB.cs

示例3: GetInstagramFeedsComment

 public string GetInstagramFeedsComment(string UserId, string FeedId)
 {
     List<Domain.Socioboard.MongoDomain.InstagramComment> lstInstagramFeed = new List<Domain.Socioboard.MongoDomain.InstagramComment>();
     try
     {
         MongoRepository instagramCommentRepo = new MongoRepository("InstagramComment");
         var ret = instagramCommentRepo.Find<Domain.Socioboard.MongoDomain.InstagramComment>(t => t.FeedId.Equals(FeedId));
         var task = Task.Run(async () =>
             {
                 return await ret;
             });
         IList<Domain.Socioboard.MongoDomain.InstagramComment> _lstInstagramFeed = task.Result.OrderBy(x => x.CommentDate).ToList();
         lstInstagramFeed = _lstInstagramFeed.ToList();
     }
     catch (Exception ex)
     {
         lstInstagramFeed = new List<Domain.Socioboard.MongoDomain.InstagramComment>();
     }
     return new JavaScriptSerializer().Serialize(lstInstagramFeed);
 }
开发者ID:prog-moh,项目名称:socioboard-core,代码行数:20,代码来源:InstagramComment.asmx.cs

示例4: GetFacebookPostComment

        public IHttpActionResult GetFacebookPostComment(string PostId)
        {
            MongoRepository fbPostRepo = new MongoRepository("FbPostComment");
            try
            {

                var result = fbPostRepo.Find<Domain.Socioboard.MongoDomain.FbPostComment>(t => t.PostId.Equals(PostId)).ConfigureAwait(false);

                var task = Task.Run(async () =>
                {
                    return await result;
                });
                IList<Domain.Socioboard.MongoDomain.FbPostComment> lstFbPostComments = task.Result;
                return Ok(lstFbPostComments.OrderByDescending(x => x.Commentdate).ToList());
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
                logger.Error(ex.StackTrace);
                return BadRequest("Something Went Wrong");
            }
        }
开发者ID:socioboard,项目名称:socioboard-core,代码行数:22,代码来源:ApiFacebookAccountController.cs

示例5: UserHomeWithLimit

        public string UserHomeWithLimit(string UserId, string FacebookId, string count)
        {
            //try
            //{
            //    Guid userid = Guid.Parse(UserId);
            //    FacebookMessageRepository fbmsgrepo = new FacebookMessageRepository();
            //    List<Domain.Socioboard.Domain.FacebookMessage> lstfbmsgs = fbmsgrepo.getFacebookUserWallPost(userid, FacebookId, Convert.ToInt32(count));
            //    return new JavaScriptSerializer().Serialize(lstfbmsgs);
            //}
            //catch (Exception ex)
            //{
            //    Console.WriteLine(ex.StackTrace);
            //    return new JavaScriptSerializer().Serialize("Please Try Again");
            //    throw;
            //}
            MongoRepository boardrepo = new MongoRepository("FacebookMessage");
            try
            {

                var result = boardrepo.Find<Domain.Socioboard.MongoDomain.FacebookMessage>(t => t.UserId.Equals(UserId) && t.ProfileId.Equals(FacebookId)).ConfigureAwait(false);

                var task = Task.Run(async () =>
                {
                    return await result;
                });
                IList<Domain.Socioboard.MongoDomain.FacebookMessage> objfbfeeds = task.Result;
                List<Domain.Socioboard.MongoDomain.FacebookMessage> fbfeeds = objfbfeeds.OrderByDescending(x => x.MessageDate).Take(Convert.ToInt32(count)).ToList();
                return new JavaScriptSerializer().Serialize(fbfeeds);

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return "Something Went Wrong";
            }

        }
开发者ID:socioboard,项目名称:socioboard-core,代码行数:37,代码来源:FacebookMessage.asmx.cs

示例6: getAllFacebookFeedsByUserIdAndProfileId1WithRange

        public string getAllFacebookFeedsByUserIdAndProfileId1WithRange(string UserId, string keyword, string ProfileId, string count)
        {
            //try
            //{
            //    List<Domain.Socioboard.Domain.FacebookFeed> lstFacebookFeed = objFacebookFeedRepository.getAllFacebookFeedsOfSBUserWithProfileIdAndRange(UserId, ProfileId, keyword, count);
            //    return new JavaScriptSerializer().Serialize(lstFacebookFeed);
            //}
            //catch (Exception ex)
            //{
            //    Console.WriteLine(ex.StackTrace);
            //    return "Something Went Wrong";
            //}




            MongoRepository boardrepo = new MongoRepository("MongoFacebookFeed");
            try
            {

                var result = boardrepo.Find<MongoFacebookFeed>(x =>  x.UserId.Equals(UserId) && x.ProfileId.Equals(ProfileId)&&x.FeedDescription.Contains(keyword)).ConfigureAwait(false);

                var task = Task.Run(async () =>
                {
                    return await result;
                });
                IList<MongoFacebookFeed> objfbfeeds = task.Result;
                return new JavaScriptSerializer().Serialize(objfbfeeds.OrderByDescending(x => x.FeedDate).Take(20));

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return "Something Went Wrong";
            }
        }
开发者ID:socioboard,项目名称:socioboard-core,代码行数:36,代码来源:FacebookFeed.asmx.cs

示例7: getAllFacebookMessagesOfUserByProfileId

        public string getAllFacebookMessagesOfUserByProfileId(string ProfileId)
        {
            //try
            //{
            //    List<Domain.Socioboard.Domain.FacebookMessage> objFacebookMessage = objFacebookMessageRepository.getAllMessageOfProfile(ProfileId);
            //    return new JavaScriptSerializer().Serialize(objFacebookMessage);
            //}
            //catch (Exception ex)
            //{
            //    Console.WriteLine(ex.StackTrace);
            //    return "Something Went Wrong";
            //}

            MongoRepository boardrepo = new MongoRepository("FacebookMessage");
            try
            {

                var result = boardrepo.Find<Domain.Socioboard.MongoDomain.FacebookMessage>(t => t.ProfileId.Equals(ProfileId)).ConfigureAwait(false);

                var task = Task.Run(async () =>
                {
                    return await result;
                });
                IList<Domain.Socioboard.MongoDomain.FacebookMessage> objfbfeeds = task.Result;
                List<Domain.Socioboard.MongoDomain.FacebookMessage> fbfeeds = objfbfeeds.OrderByDescending(t => t.MessageDate).ToList();
                return new JavaScriptSerializer().Serialize(fbfeeds);

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return "Something Went Wrong";
            }
        }
开发者ID:socioboard,项目名称:socioboard-core,代码行数:34,代码来源:FacebookMessage.asmx.cs

示例8: GetInstagramSelfFeeds

        public void GetInstagramSelfFeeds(string instagramId, string accessToken)
        {
            MongoRepository instagarmCommentRepo = new MongoRepository("InstagramComment");
            MongoRepository instagramFeedRepo = new MongoRepository("InstagramFeed");
            try
            {
                GlobusInstagramLib.Instagram.Core.UsersMethods.Users userInstagram = new GlobusInstagramLib.Instagram.Core.UsersMethods.Users();
                GlobusInstagramLib.Instagram.Core.MediaMethods.Media _Media = new GlobusInstagramLib.Instagram.Core.MediaMethods.Media();
                InstagramResponse<Comment[]> usercmts = new InstagramResponse<Comment[]>();
                CommentController objComment = new CommentController();
                LikesController objLikes = new LikesController();
                string feeds = _Media.UserResentFeeds(instagramId, accessToken);
                if (feeds != null)
                {
                    JObject feed_data = JObject.Parse(feeds);

                    foreach (var item in feed_data["data"])
                    {
                        try
                        {
                            Domain.Socioboard.MongoDomain.InstagramFeed objInstagramFeed = new Domain.Socioboard.MongoDomain.InstagramFeed();
                            try
                            {
                                objInstagramFeed.FeedDate = item["created_time"].ToString();
                            }
                            catch { }
                            try
                            {
                                objInstagramFeed.FeedId = item["id"].ToString();
                            }
                            catch { }
                            try
                            {
                                objInstagramFeed.Type = item["type"].ToString();
                                if (objInstagramFeed.Type == "video")
                                {
                                    objInstagramFeed.VideoUrl = item["videos"]["standard_resolution"]["url"].ToString();
                                }
                            }
                            catch { }
                            try
                            {
                                objInstagramFeed.FeedImageUrl = item["images"]["standard_resolution"]["url"].ToString();
                            }
                            catch { }
                            try
                            {
                                objInstagramFeed.InstagramId = instagramId;
                            }
                            catch { }
                            try
                            {
                                objInstagramFeed.LikeCount = Int32.Parse(item["likes"]["count"].ToString());
                            }
                            catch { }
                            try
                            {
                                objInstagramFeed.CommentCount = Int32.Parse(item["comments"]["count"].ToString());
                            }
                            catch { }
                            try
                            {
                                string str = item["user_has_liked"].ToString();
                                if (str.ToLower() == "false")
                                {
                                    objInstagramFeed.IsLike = 0;
                                }
                                else { objInstagramFeed.IsLike = 1; }
                            }
                            catch { }
                            try
                            {
                                objInstagramFeed.AdminUser = item["user"]["username"].ToString();
                            }
                            catch { }
                            try
                            {
                                objInstagramFeed.Feed = item["caption"]["text"].ToString();
                            }
                            catch { }
                            try
                            {
                                objInstagramFeed.ImageUrl = item["user"]["profile_picture"].ToString();
                            }
                            catch { }
                            try
                            {
                                objInstagramFeed.FromId = item["user"]["id"].ToString();
                            }
                            catch { }
                            try
                            {
                                objInstagramFeed.FeedUrl = item["link"].ToString();
                            }
                            catch { }

                            var ret = instagramFeedRepo.Find<Domain.Socioboard.MongoDomain.InstagramFeed>(t => t.FeedId.Equals(objInstagramFeed.FeedId) && t.InstagramId.Equals(objInstagramFeed.InstagramId));
                            var task = Task.Run(async () =>
                            {
                                return await ret;
//.........这里部分代码省略.........
开发者ID:socioboard,项目名称:socioboard-core,代码行数:101,代码来源:Instagram.asmx.cs

示例9: getUserFeed


//.........这里部分代码省略.........
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.InReplyToStatusUserId = item["in_reply_to_status_id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.Id = ObjectId.GenerateNewId();
                        objTwitterFeed.strId = ObjectId.GenerateNewId().ToString();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FromProfileUrl = item["user"]["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FromName = item["user"]["name"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FromId = item["user"]["id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    //objTwitterFeed.EntryDate = DateTime.Now;
                    try
                    {
                        objTwitterFeed.FromScreenName = item["user"]["screen_name"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    var ret = twitterfeedrepo.Find<Domain.Socioboard.MongoDomain.TwitterFeed>(t => t.MessageId.Equals(objTwitterFeed.MessageId));
                    var task = Task.Run(async () =>
                    {
                        return await ret;
                    });
                    int count = task.Result.Count;

                    if (count < 1)
                    {
                        twitterfeedrepo.Add(objTwitterFeed);
                    }


                    // Edited by Antima[20/12/2014]

                    //SentimentalAnalysis _SentimentalAnalysis = new SentimentalAnalysis();
                    //FeedSentimentalAnalysisRepository _FeedSentimentalAnalysisRepository = new FeedSentimentalAnalysisRepository();
                    //try
                    //{
                    //    if (_FeedSentimentalAnalysisRepository.checkFeedExists(objTwitterFeed.ProfileId.ToString(), userId, objTwitterFeed.Id.ToString()))
                    //    {
                    //        if (!string.IsNullOrEmpty(objTwitterFeed.Feed))
                    //        {
                    //            string Network = "twitter";
                    //            _SentimentalAnalysis.GetPostSentimentsFromUclassify(userId, objTwitterFeed.ProfileId, objTwitterFeed.MessageId, objTwitterFeed.Feed, Network);
                    //        }
                    //    }
                    //}
                    //catch (Exception)
                    //{

                    //}

                    //if (!twtmsgrepo.checkTwitterFeedExists(objTwitterFeed.ProfileId, objTwitterFeed.UserId, objTwitterFeed.MessageId))
                    //{
                    //    twtmsgrepo.addTwitterFeed(objTwitterFeed);
                    //}

                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }


        }
开发者ID:socioboard,项目名称:socioboard-core,代码行数:101,代码来源:Twitter.asmx.cs

示例10: GetAllMessageDetailWithRange

        public string GetAllMessageDetailWithRange(string profileid, string noOfDataToSkip, string UserId)
        {
            //List<Domain.Socioboard.Domain.FacebookMessage> lstFacebookMessage = objFacebookMessageRepository.getAllMessageDetail(profileid, noOfDataToSkip, Guid.Parse(UserId));
            //return new JavaScriptSerializer().Serialize(lstFacebookMessage);


            MongoRepository boardrepo = new MongoRepository("FacebookMessage");
            try
            {
                string[] arrsrt = profileid.Split(',');
                var result = boardrepo.Find<Domain.Socioboard.MongoDomain.FacebookMessage>(t => t.ProfileId.Equals(profileid) && arrsrt.Contains(t.ProfileId) && !t.IsArchived.Equals("1")).ConfigureAwait(false);

                var task = Task.Run(async () =>
                {
                    return await result;
                });
                IList<Domain.Socioboard.MongoDomain.FacebookMessage> objfbfeeds = task.Result;

                return new JavaScriptSerializer().Serialize(objfbfeeds.OrderByDescending(x => x.MessageDate).Skip(Convert.ToInt32(noOfDataToSkip)).Take(15).ToList());

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return "Something Went Wrong";
            }
        }
开发者ID:socioboard,项目名称:socioboard-core,代码行数:27,代码来源:FacebookMessage.asmx.cs

示例11: getAllFacebookMessagesOfUserByProfileIdWithRange

        public string getAllFacebookMessagesOfUserByProfileIdWithRange(string ProfileId, string noOfDataToSkip, string UseId)
        {
            //try
            //{
            //    List<Domain.Socioboard.Domain.FacebookMessage> objFacebookMessage = objFacebookMessageRepository.getAllMessageOfProfileWithRange(ProfileId, noOfDataToSkip, Guid.Parse(UseId));
            //    return new JavaScriptSerializer().Serialize(objFacebookMessage);
            //}
            //catch (Exception ex)
            //{
            //    Console.WriteLine(ex.StackTrace);
            //    return "Something Went Wrong";
            //}


            MongoRepository boardrepo = new MongoRepository("FacebookMessage");
            try
            {

                var result = boardrepo.Find<Domain.Socioboard.MongoDomain.FacebookMessage>(t => t.UserId.Equals(UseId) && t.ProfileId.Equals(ProfileId) && t.ProfileId != t.FromId && t.IsArchived.Equals("1")).ConfigureAwait(false);

                var task = Task.Run(async () =>
                {
                    return await result;
                });
                IList<Domain.Socioboard.MongoDomain.FacebookMessage> objfbfeeds = task.Result;

                return new JavaScriptSerializer().Serialize(objfbfeeds.OrderByDescending(x => x.MessageDate).Skip(Convert.ToInt32(noOfDataToSkip)).Take(15).ToList());

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return "Something Went Wrong";
            }
        }
开发者ID:socioboard,项目名称:socioboard-core,代码行数:35,代码来源:FacebookMessage.asmx.cs

示例12: getAllFacebookUserFeedOfUsersByUserIdAndProfileId1WithRange

        public string getAllFacebookUserFeedOfUsersByUserIdAndProfileId1WithRange(string UserId, string keyword, string ProfileId, string count)
        {
            //try
            //{
            //    List<Domain.Socioboard.Domain.FacebookMessage> lstFacebookUserFeed = objFacebookMessageRepository.getAllFacebookUserFeedOfUsersByUserIdAndProfileId1WithRange(UserId, keyword, ProfileId, count);
            //    return new JavaScriptSerializer().Serialize(lstFacebookUserFeed);
            //}
            //catch (Exception ex)
            //{
            //    Console.WriteLine(ex.StackTrace);
            //    return "Something Went Wrong";
            //}

            MongoRepository boardrepo = new MongoRepository("FacebookMessage");
            try
            {

                var result = boardrepo.Find<Domain.Socioboard.MongoDomain.FacebookMessage>(t => t.UserId.Equals(UserId) && t.ProfileId.Equals(ProfileId) && t.ProfileId != t.FromId && t.Type.Equals("fb_home") && t.Message.Contains(keyword)).ConfigureAwait(false);

                var task = Task.Run(async () =>
                {
                    return await result;
                });
                IList<Domain.Socioboard.MongoDomain.FacebookMessage> objfbfeeds = task.Result;

                return new JavaScriptSerializer().Serialize(objfbfeeds.OrderByDescending(x => x.MessageDate).Take(20).ToList());

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return "Something Went Wrong";
            }
        }
开发者ID:socioboard,项目名称:socioboard-core,代码行数:34,代码来源:FacebookMessage.asmx.cs

示例13: getAllFacebookMessagesByUserIdWithRange

        public string getAllFacebookMessagesByUserIdWithRange(string UserId, string noOfDataToSkip)
        {
            //List<Domain.Socioboard.Domain.FacebookMessage> lstFacebookMessage = new List<Domain.Socioboard.Domain.FacebookMessage>();
            //try
            //{
            //    //if (objFacebookFeedRepository.checkFacebookUserExists(ProfileId, Guid.Parse(UserId)))
            //    {
            //        lstFacebookMessage = objFacebookMessageRepository.getAllFacebookMessagesOfSBUserWithRange(UserId, noOfDataToSkip);
            //    }
            //    //else
            //    //{
            //    //    lstFacebookFeed = objFacebookFeedRepository.getAllFacebookUserFeeds(ProfileId);
            //    //}
            //    return new JavaScriptSerializer().Serialize(lstFacebookMessage);
            //}
            //catch (Exception ex)
            //{
            //    Console.WriteLine(ex.StackTrace);
            //    return "Something Went Wrong";
            //}


            MongoRepository boardrepo = new MongoRepository("FacebookMessage");
            try
            {

                var result = boardrepo.Find<Domain.Socioboard.MongoDomain.FacebookMessage>(t => t.UserId.Equals(UserId)).ConfigureAwait(false);

                var task = Task.Run(async () =>
                {
                    return await result;
                });
                IList<Domain.Socioboard.MongoDomain.FacebookMessage> objfbfeeds = task.Result;

                return new JavaScriptSerializer().Serialize(objfbfeeds.Skip(Convert.ToInt32(noOfDataToSkip)).Take(20).ToList());

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return "Something Went Wrong";
            }
        }
开发者ID:socioboard,项目名称:socioboard-core,代码行数:43,代码来源:FacebookMessage.asmx.cs

示例14: GetFacebookMessageByMessageId

        public string GetFacebookMessageByMessageId(string userid, string msgid)
        {
            //Domain.Socioboard.Domain.FacebookMessage objFacebookMessage = objFacebookMessageRepository.GetFacebookMessageByMessageId(Guid.Parse(userid), msgid);
            //return new JavaScriptSerializer().Serialize(objFacebookMessage);
            MongoRepository boardrepo = new MongoRepository("FacebookMessage");
            try
            {

                var result = boardrepo.Find<Domain.Socioboard.MongoDomain.FacebookMessage>(t => t.MessageId.Equals(msgid) && t.UserId.Equals(userid)).ConfigureAwait(false);

                var task = Task.Run(async () =>
                {
                    return await result;
                });
                IList<Domain.Socioboard.MongoDomain.FacebookMessage> objfbfeeds = task.Result;
                return new JavaScriptSerializer().Serialize(objfbfeeds.FirstOrDefault());

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return "Something Went Wrong";
            }
        }
开发者ID:socioboard,项目名称:socioboard-core,代码行数:24,代码来源:FacebookMessage.asmx.cs

示例15: getAllFacebookUserFeedOfUsers

        public string getAllFacebookUserFeedOfUsers(string UserId, string ProfileId)
        {
            //try
            //{
            //    List<Domain.Socioboard.Domain.FacebookMessage> lstFacebookUserFeed = objFacebookMessageRepository.getAllFacebookUserFeedOfUsers(Guid.Parse(UserId), ProfileId);
            //    return new JavaScriptSerializer().Serialize(lstFacebookUserFeed);
            //}
            //catch (Exception ex)
            //{
            //    Console.WriteLine(ex.StackTrace);
            //    return "Something Went Wrong";
            //}



            MongoRepository boardrepo = new MongoRepository("FacebookMessage");
            try
            {

                var result = boardrepo.Find<Domain.Socioboard.MongoDomain.FacebookMessage>(t => t.ProfileId.Equals(ProfileId) && t.Type.Equals("fb_home") && t.UserId.Equals(UserId)).ConfigureAwait(false);

                var task = Task.Run(async () =>
                {
                    return await result;
                });
                IList<Domain.Socioboard.MongoDomain.FacebookMessage> objfbfeeds = task.Result;
                return new JavaScriptSerializer().Serialize(objfbfeeds);

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return "Something Went Wrong";
            }
        }
开发者ID:socioboard,项目名称:socioboard-core,代码行数:35,代码来源:FacebookMessage.asmx.cs


注:本文中的MongoRepository.Find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。