public void getFanPost(string pageId, Guid UserId, int days)
        {
            string strStories = "https://graph.facebook.com/" + pageId + "/feed";
            FacebookClient fb = new FacebookClient();
            FacebookAccountRepository fbAccRepo = new FacebookAccountRepository();
            FacebookAccount acc = fbAccRepo.getUserDetails(pageId);
            fb.AccessToken = acc.AccessToken;
            JsonObject outputreg = (JsonObject)fb.Get(strStories);
            JArray data = (JArray)JsonConvert.DeserializeObject(outputreg["data"].ToString());
            FacebookInsightPostStats objFbiPost = new FacebookInsightPostStats();
            FacebookInsightPostStatsRepository objfbiPostRepo = new FacebookInsightPostStatsRepository();

            foreach (var item in data)
            {

                try
                {
                    objFbiPost.Id = Guid.NewGuid();
                    objFbiPost.EntryDate = DateTime.Now;
                    objFbiPost.PageId = pageId;
                    try
                    {
                        objFbiPost.PostMessage = item["story"].ToString();
                    }
                    catch (Exception Err)
                    {
                        objFbiPost.PostMessage = item["message"].ToString();
                    }
                    objFbiPost.PostDate = item["created_time"].ToString();
                    JArray arrComment = (JArray)item["comment"];
                    if (arrComment != null)
                        objFbiPost.PostComments = arrComment.Count;
                    else
                        objFbiPost.PostComments = 0;
                    objFbiPost.PostId = item["id"].ToString();
                    objFbiPost.UserId = UserId;
                    if (!objfbiPostRepo.checkFacebookInsightPostStatsExists(pageId, item["id"].ToString(), UserId, item["created_time"].ToString()))
                        objfbiPostRepo.addFacebookInsightPostStats(objFbiPost);
                    else
                        objfbiPostRepo.updateFacebookInsightPostStats(objFbiPost);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }

        }