public async Task <dynamic> GetDocPropIdentityForSpecificUser(string _DocPropertyID, string _DestroyPolicyID) { List <DSM_DocPropIdentify> objDocPropIdentifies = null; List <DSM_DestroyPolicy> dsmDestroyPolicies = null; await Task.Run(() => _ownerProperIdentityService.GetDocPropIdentify(UserID, "", out objDocPropIdentifies)); await Task.Run(() => _destroyPolicyService.GetDestroyPolicyBySearchParam(_DestroyPolicyID, UserID, null, null, null, _DocPropertyID, null, out dsmDestroyPolicies)); if (_DestroyPolicyID != "") { var result = (from dc in objDocPropIdentifies where dc.DocPropertyID == _DocPropertyID & dc.Status == 1 join dpd in dsmDestroyPolicies on new { DocPropIdentifyID = dc.DocPropIdentifyID, //DestroyPolicyID = _DestroyPolicyID } equals new { DocPropIdentifyID = dpd.DocPropIdentifyID, //DestroyPolicyID = _DestroyPolicyID } into Policies from dpd in Policies.DefaultIfEmpty() //where dpd.DestroyPolicyID == _DestroyPolicyID select new { DestroyPolicyDtlID = dpd == null ? "" : dpd.DestroyPolicyDtlID, DocPropIdentifyID = dc.DocPropIdentifyID, IdentificationAttribute = dc.IdentificationAttribute, IsSelected = (dpd != null && dpd.IsSelected), TimeValue = (dpd == null ? "" : dpd.TimeValue), TimeUnit = (dpd == null ? "" : dpd.TimeUnit), ExceptionValue = (dpd == null ? "" : dpd.ExceptionValue) }).ToList(); return(Json(new { Msg = "", result }, JsonRequestBehavior.AllowGet)); } else { var result = (from dc in objDocPropIdentifies where dc.DocPropertyID == _DocPropertyID & dc.Status == 1 select new { DocPropIdentifyID = dc.DocPropIdentifyID, IdentificationAttribute = dc.IdentificationAttribute, IsSelected = false }).ToList(); return(Json(new { Msg = "", result }, JsonRequestBehavior.AllowGet)); } }