public List<DashboardUser> ShowAllAccessRights(string dashboard) { int dashboardID = Convert.ToInt32(dashboard); StoredProcedureDataContext dbmlObject = new StoredProcedureDataContext(); var ShowAccessRightResult = dbmlObject.ShowAllAccessRights(dashboardID).ToList(); List<DashboardUser> UserList = new List<DashboardUser>(); //proper conversion logic foreach (var i in ShowAccessRightResult) { UserList.Add(new DashboardUser { DashboardId = dashboardID, Name = i.FirstName, UserId = i.UserID, AccessRight = new AccessRight() { AccessRightName = i.AccessRight } }); } return UserList; }
public List <DashboardUser> ShowAllAccessRights(string dashboard) { int dashboardID = Convert.ToInt32(dashboard); StoredProcedureDataContext dbmlObject = new StoredProcedureDataContext(); var ShowAccessRightResult = dbmlObject.ShowAllAccessRights(dashboardID).ToList(); List <DashboardUser> UserList = new List <DashboardUser>(); //proper conversion logic foreach (var i in ShowAccessRightResult) { UserList.Add(new DashboardUser { DashboardId = dashboardID, Name = i.FirstName, UserId = i.UserID, AccessRight = new AccessRight() { AccessRightName = i.AccessRight } }); } return(UserList); }