public List <RequestLogVm> ListRequestLog()
        {
            using (var db = new LMISEntities())
            {
                return(db.RequestLogs
                       .AsNoTracking()

                       .Select(r => new
                {
                    RequestLog = r,
                    db.Admins.FirstOrDefault(a => a.AdminId == r.AdminID).AdminName,
                    PortalUserName = SqlUdf.PortalUserName(r.PortalUserID, 1),
                    RequestTypeDesc = SqlUdf.SubCodeName(r.RequestType, 1),
                    Title = SqlUdf.RequestTitle(r.RequestType, r.RequestID, 1),
                    DeleteDate = SqlUdf.RequestDeleteDate(r.RequestType, r.RequestID)
                })
                       .ToList()
                       .Select(r => new RequestLogVm
                {
                    Id = (long)r.RequestLog.ID,
                    Admin = new CodeSet
                    {
                        id = r.RequestLog.AdminID,
                        desc = r.AdminName
                    },
                    PortalUserId = (long)r.RequestLog.PortalUserID,
                    PortalUserName = r.PortalUserName,
                    RequestType = new CodeSet
                    {
                        id = r.RequestLog.RequestType,
                        desc = r.RequestTypeDesc
                    },
                    RequestId = (long)r.RequestLog.RequestID,
                    Title = r.Title,
                    PostDate = r.RequestLog.PostDate,
                    UpdateDate = r.RequestLog.UpdateDate,
                    DeleteDate = r.DeleteDate,
                    Approval = (Approval)r.RequestLog.Is_Approved
                })
                       .ToList());
            }
        }