コード例 #1
0
        public HttpResponseMessage getByProfileID(string ID)
        {
            ProfileCore objProfCore = null;

            if (!string.IsNullOrWhiteSpace(ID))
            {
                string strLoggedInUserID          = string.Empty;
                IEnumerable <string> headerValues = Request.Headers.GetValues("MugurthamUserToken");
                strLoggedInUserID = headerValues.FirstOrDefault();

                Mugurtham.Core.Login.LoggedInUser objLoggedIn = new Core.Login.LoggedInUser(strLoggedInUserID,
                                                                                            Request.Headers.GetValues("CommunityID").FirstOrDefault());
                using (objLoggedIn as IDisposable)
                {
                    // Destroy this objLoggedIn object
                    ProfileCore objProfileCore = new ProfileCore(ref objLoggedIn);
                    using (objProfileCore as IDisposable)
                        objProfileCore.GetByProfileID(ID, out objProfCore, objLoggedIn);
                    objProfileCore = null;
                }
                objLoggedIn = null;
            }
            return(Request.CreateResponse(HttpStatusCode.OK, objProfCore,
                                          Configuration.Formatters.JsonFormatter));
        }
コード例 #2
0
        public ActionResult getByProfileID(string ProfileID)
        {
            Mugurtham.Core.Login.LoggedInUser objLoggedIn = (Mugurtham.Core.Login.LoggedInUser)Session["LoggedInUser"];
            ProfileCore objProfileCoreReturn = new ProfileCore(ref objLoggedIn);
            ProfileCore objProfileCore       = new ProfileCore(ref objLoggedIn);

            using (objProfileCore as IDisposable)
            {
                objProfileCore.GetByProfileID(ProfileID, out objProfileCoreReturn, objLoggedIn);
            }
            objProfileCore = null;
            return(this.Json(objProfileCoreReturn, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        public HttpResponseMessage getProfileByProfileID(string ID)
        {
            ProfileCore objProfileCoreForView = null;

            Mugurtham.Core.Login.LoggedInUser objLoggedIn = new Core.Login.LoggedInUser(Request.Headers.GetValues("MugurthamUserToken").FirstOrDefault(),
                                                                                        Request.Headers.GetValues("CommunityID").FirstOrDefault());
            using (objLoggedIn as IDisposable)
            {
                ProfileCore objProfileCore = new ProfileCore(ref objLoggedIn);
                using (objProfileCore as IDisposable)
                {
                    objProfileCore.GetByProfileID(ID, out objProfileCoreForView, objLoggedIn);
                }
                objProfileCore = null;
            }
            objLoggedIn = null;
            return(Request.CreateResponse(HttpStatusCode.OK, objProfileCoreForView,
                                          Configuration.Formatters.JsonFormatter));
        }