fcatae/Arda

[Kanban] AppointmentRepository.GetAllAppointments does not return UserName

Closed this issue · 4 comments

It returns the user unique name, but not the user name.

            var response = (from a in _context.Appointments
                            join w in _context.WorkloadBacklogs on a.AppointmentWorkload.WBID equals w.WBID
                            orderby a.AppointmentDate descending
                            select new AppointmentViewModel
                            {
                                _AppointmentID = a.AppointmentID,
                                _AppointmentWorkloadWBID = a.AppointmentWorkload.WBID,
                                _WorkloadTitle = w.WBTitle,
                                _AppointmentDate = a.AppointmentDate,
                                _AppointmentHoursDispensed = a.AppointmentHoursDispensed,
                                _AppointmentUserUniqueName = a.AppointmentUser.UniqueName
                            }).ToList();

The same applies to public List<AppointmentViewModel> GetAllAppointments(string user)

It also happens at public AppointmentViewModel GetAppointmentByID(Guid id)

It does not return UserName, but it returns UniqueName.

Workaround: lookup username by UniqueName.

Closing as won't fix.
Reason: it requires an additional join to retrieve the username. However, this information is not important and it is quite expensive (in terms of network bandwidth). There is no demand to justify it.