public dynamic get(DBOYinfo1 DBI) { try { var identity = User.Identity as ClaimsIdentity; int compid = 0, userid = 0; foreach (Claim claim in identity.Claims) { if (claim.Type == "compid") { compid = int.Parse(claim.Value); } if (claim.Type == "userid") { userid = int.Parse(claim.Value); } } logger.Info("User ID : {0} , Company Id : {1}", compid, userid); List <ItemMaster> returnlist = new List <ItemMaster>(); AuthContext context = new AuthContext(); foreach (var i in DBI.ids) { var lst = context.AddDamageStock(i.id, DBI.Warehouseid, compid); if (lst != null) { List <ItemMaster> os = lst.otmaster; returnlist.AddRange(os); } } return(returnlist); } catch (Exception ex) { return(null); } }