Copy and paste the below code
List userAttendancesWithDeptCode = new List();
userAttendancesWithDeptCode = (from useratt in dataContext.UserAttendances
join userRoles in dataContext.UserRoles on useratt.UserID equals userRoles.UserID
join roleMaster in dataContext.RoleMasters on userRoles.RoleID equals roleMaster.RoleID
join teamMaster in dataContext.TeamMasters on roleMaster.TeamID equals teamMaster.TeamID
select new
{
AttendanceID = useratt.AttendanceID,
UserID = useratt.UserID,
IsAttendance = useratt.IsAttendance,
AttendanceDate = useratt.AttendanceDate,
IsDeleted = useratt.IsDeleted,
Sync = useratt.Sync,
DeptCode = teamMaster.Code
}).Distinct().ToList();
List userAttendancesWithDeptCode = new List();
userAttendancesWithDeptCode = (from useratt in dataContext.UserAttendances
join userRoles in dataContext.UserRoles on useratt.UserID equals userRoles.UserID
join roleMaster in dataContext.RoleMasters on userRoles.RoleID equals roleMaster.RoleID
join teamMaster in dataContext.TeamMasters on roleMaster.TeamID equals teamMaster.TeamID
select new
{
AttendanceID = useratt.AttendanceID,
UserID = useratt.UserID,
IsAttendance = useratt.IsAttendance,
AttendanceDate = useratt.AttendanceDate,
IsDeleted = useratt.IsDeleted,
Sync = useratt.Sync,
DeptCode = teamMaster.Code
}).Distinct().ToList();
No comments:
Post a Comment