@ismcagdas, yes, the application pool start model is always running, furthermore application pool without recycling.
It is a so urgently confusion issue, I don't kown when the application will not availble, online service is unreliable。
Unfortunately, this is not the real reason, after a new deployment, it happened again. logs record below repeated logs as below:
INFO 2018-06-22 09:12:01,820 [10 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.0 HEAD http://127.0.0.1:14395/
INFO 2018-06-22 09:12:01,829 [10 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "Index", controller = "Home", area = ""}. Executing action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc)
INFO 2018-06-22 09:12:01,832 [10 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) with arguments (, False) - Validation state: Valid
INFO 2018-06-22 09:12:01,832 [10 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.RedirectToActionResult in 0.0266ms.
INFO 2018-06-22 09:12:01,844 [10 ] ft.AspNetCore.Mvc.RedirectToActionResult - Executing RedirectResult, redirecting to /Account/Login.
INFO 2018-06-22 09:12:01,844 [10 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) in 15.145ms
INFO 2018-06-22 09:12:01,845 [10 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 24.635ms 302
INFO 2018-06-22 09:18:12,102 [38 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.0 HEAD http://127.0.0.1:14395/
INFO 2018-06-22 09:18:12,109 [38 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "Index", controller = "Home", area = ""}. Executing action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc)
INFO 2018-06-22 09:18:12,111 [38 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) with arguments (, False) - Validation state: Valid
INFO 2018-06-22 09:18:12,111 [38 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.RedirectToActionResult in 0.0274ms.
INFO 2018-06-22 09:18:12,122 [38 ] ft.AspNetCore.Mvc.RedirectToActionResult - Executing RedirectResult, redirecting to /Account/Login.
INFO 2018-06-22 09:18:12,122 [38 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) in 12.2954ms
INFO 2018-06-22 09:18:12,122 [38 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 20.5415ms 302
INFO 2018-06-22 09:19:50,981 [25 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.0 HEAD http://127.0.0.1:14395/
INFO 2018-06-22 09:19:50,988 [25 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "Index", controller = "Home", area = ""}. Executing action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc)
INFO 2018-06-22 09:19:50,990 [25 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) with arguments (, False) - Validation state: Valid
INFO 2018-06-22 09:19:50,990 [25 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.RedirectToActionResult in 0.0244ms.
INFO 2018-06-22 09:19:51,002 [25 ] ft.AspNetCore.Mvc.RedirectToActionResult - Executing RedirectResult, redirecting to /Account/Login.
INFO 2018-06-22 09:19:51,002 [25 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) in 13.4572ms
INFO 2018-06-22 09:19:51,002 [25 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 21.0892ms 302
INFO 2018-06-22 09:22:22,434 [65 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.0 HEAD http://127.0.0.1:14395/
INFO 2018-06-22 09:22:22,442 [65 ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "Index", controller = "Home", area = ""}. Executing action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc)
INFO 2018-06-22 09:22:22,444 [65 ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) with arguments (, False) - Validation state: Valid
INFO 2018-06-22 09:22:22,445 [65 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.RedirectToActionResult in 0.0276ms.
INFO 2018-06-22 09:22:22,453 [65 ] ft.AspNetCore.Mvc.RedirectToActionResult - Executing RedirectResult, redirecting to /Account/Login.
INFO 2018-06-22 09:22:22,453 [65 ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Viewtance.SRP.Web.Controllers.HomeController.Index (Viewtance.SRP.Web.Mvc) in 10.8877ms
INFO 2018-06-22 09:22:22,454 [65 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 19.8017ms 302
Yes, I am using the MVC&jQuery edition, I already found this fix and applied, the application is running normally almost one day, I hope this issue is the reason behind and it could be fixed by this approach.
Thanks for your information.
Yes, it generated by RAD tool, as below:
public class StudentsAppService : SchoolAppServiceBase, IStudentsAppService
{
private readonly IRepository<Student, long> _studentRepository;
private readonly IStudentsExcelExporter _studentsExcelExporter;
private readonly IRepository<User,long> _userRepository;
private readonly IRepository<Term,long> _termRepository;
private readonly IRepository<Grade,long> _gradeRepository;
private readonly IRepository<Class,long> _classRepository;
private readonly IRepository<GetInTouchPathway,long> _getInTouchPathwayRepository;
//GA module entity
private readonly IRepository<Room, long> _roomRepository;
private readonly IRepository<Bunk, long> _bunkRepository;
public StudentsAppService(IRepository<Student, long> studentRepository,
IStudentsExcelExporter studentsExcelExporter ,
IRepository<User, long> userRepository,
IRepository<Term, long> termRepository,
IRepository<Grade, long> gradeRepository,
IRepository<Class, long> classRepository,
IRepository<GetInTouchPathway, long> getInTouchPathwayRepository,
IRepository<Room, long> roomRepository,
IRepository<Bunk, long> bunkRepository)
{
_studentRepository = studentRepository;
_studentsExcelExporter = studentsExcelExporter;
_userRepository = userRepository;
_termRepository = termRepository;
_gradeRepository = gradeRepository;
_classRepository = classRepository;
_getInTouchPathwayRepository = getInTouchPathwayRepository;
_roomRepository = roomRepository;
_bunkRepository = bunkRepository;
}
public async Task<PagedResultDto<GetStudentForView>> GetAll(GetAllStudentsInput input)
{
var filteredStudents = _studentRepository.GetAll()
.WhereIf(!string.IsNullOrWhiteSpace(input.Filter), e => false || e.Name.Contains(input.Filter) || e.Surname.Contains(input.Filter) || e.PersonalName.Contains(input.Filter) || e.Number.Contains(input.Filter) || e.RegisteredResidence.Contains(input.Filter) || e.PhoneNumber.Contains(input.Filter) || e.IDNumber.Contains(input.Filter) || e.WeChat.Contains(input.Filter) || e.QQ.Contains(input.Filter) || e.FatherName.Contains(input.Filter) || e.FatherPhoneNumber.Contains(input.Filter) || e.FatherWeChat.Contains(input.Filter) || e.MotherName.Contains(input.Filter) || e.MotherPhoneNumber.Contains(input.Filter) || e.MotherWeChat.Contains(input.Filter) || e.ProfessionalCourseAppraisal.Contains(input.Filter) || e.LiteracyCourseAppraisal.Contains(input.Filter) || e.CustomAttributes.Contains(input.Filter))
.WhereIf(!string.IsNullOrWhiteSpace(input.NameFilter), e => e.Name.ToLower() == input.NameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.SurnameFilter), e => e.Surname.ToLower() == input.SurnameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.PersonalNameFilter), e => e.PersonalName.ToLower() == input.PersonalNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.NumberFilter), e => e.Number.ToLower() == input.NumberFilter.ToLower().Trim())
.WhereIf(input.Sex != null, e => e.Sex == input.Sex)
.WhereIf(input.MinBirthdayFilter != null, e => e.Birthday >= input.MinBirthdayFilter)
.WhereIf(input.MaxBirthdayFilter != null, e => e.Birthday <= input.MaxBirthdayFilter)
.WhereIf(!string.IsNullOrWhiteSpace(input.RegisteredResidenceFilter), e => e.RegisteredResidence.ToLower() == input.RegisteredResidenceFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.PhoneNumberFilter), e => e.PhoneNumber.ToLower() == input.PhoneNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.IDNumberFilter), e => e.IDNumber.ToLower() == input.IDNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.WeChatFilter), e => e.WeChat.ToLower() == input.WeChatFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.QQFilter), e => e.QQ.ToLower() == input.QQFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.FatherNameFilter), e => e.FatherName.ToLower() == input.FatherNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.FatherPhoneNumberFilter), e => e.FatherPhoneNumber.ToLower() == input.FatherPhoneNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.FatherWeChatFilter), e => e.FatherWeChat.ToLower() == input.FatherWeChatFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.MotherNameFilter), e => e.MotherName.ToLower() == input.MotherNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.MotherPhoneNumberFilter), e => e.MotherPhoneNumber.ToLower() == input.MotherPhoneNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.MotherWeChatFilter), e => e.MotherWeChat.ToLower() == input.MotherWeChatFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.ProfessionalCourseAppraisalFilter), e => e.ProfessionalCourseAppraisal.ToLower() == input.ProfessionalCourseAppraisalFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.LiteracyCourseAppraisalFilter), e => e.LiteracyCourseAppraisal.ToLower() == input.LiteracyCourseAppraisalFilter.ToLower().Trim());
var query = (from o in filteredStudents
join o1 in _userRepository.GetAll() on o.UserId equals o1.Id into j1
from s1 in j1.DefaultIfEmpty()
join o2 in _termRepository.GetAll() on o.TermId equals o2.Id into j2
from s2 in j2.DefaultIfEmpty()
join o3 in _gradeRepository.GetAll() on o.GradeId equals o3.Id into j3
from s3 in j3.DefaultIfEmpty()
join o4 in _classRepository.GetAll() on o.ClassId equals o4.Id into j4
from s4 in j4.DefaultIfEmpty()
join o5 in _getInTouchPathwayRepository.GetAll() on o.GetInTouchPathwayId equals o5.Id into j5
from s5 in j5.DefaultIfEmpty()
join o6 in _roomRepository.GetAll() on o.DormitoryRoomId.Value equals o6.Id into j6
from s6 in j6.DefaultIfEmpty()
select new GetStudentForView() { Student = ObjectMapper.Map<StudentDto>(o),
UserName = s1 == null ? "" : s1.Name.ToString(),
TermName = s2 == null ? "" : s2.Name.ToString(),
GradeName = s3 == null ? "" : s3.Name.ToString(),
ClassName = s4 == null ? "" : s4.Name.ToString(),
GetInTouchPathwayName = s5 == null ? "" : s5.Name.ToString(),
SexTypeName = L(string.Format("Enums.{0}.{1}", typeof(SexType).ToString().Split('.', StringSplitOptions.RemoveEmptyEntries).Last(), o.SexType.ToString())),
DormitoryRoomName = s6 == null ? "" : s6.Name.ToString()
})
.WhereIf(!string.IsNullOrWhiteSpace(input.UserNameFilter), e => e.UserName.ToLower() == input.UserNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.TermNameFilter), e => e.TermName.ToLower() == input.TermNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.GradeNameFilter), e => e.GradeName.ToLower() == input.GradeNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.ClassNameFilter), e => e.ClassName.ToLower() == input.ClassNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.GetInTouchPathwayNameFilter), e => e.GetInTouchPathwayName.ToLower() == input.GetInTouchPathwayNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.DormitoryRoomNameFilter), e => e.DormitoryRoomName.ToLower() == input.DormitoryRoomNameFilter.ToLower().Trim());
var totalCount = await query.CountAsync();
var students = await query
.OrderBy(input.Sorting ?? "student.id asc")
.PageBy(input)
.ToListAsync();
return new PagedResultDto<GetStudentForView>(
totalCount,
students
);
}
[AbpAuthorize(AppPermissions.Pages_Students_Edit)]
public async Task<GetStudentForEditOutput> GetStudentForEdit(GetStudentForEditInput input)
{
Student student;
student = await _studentRepository.FirstOrDefaultAsync(input.StudentId);
if (input.UserId > 0)
{
student = await _studentRepository.GetAll()
.Where(e => e.UserId == input.UserId).FirstOrDefaultAsync();
}
var output = new GetStudentForEditOutput {Student = ObjectMapper.Map<CreateOrEditStudentDto>(student)};
var sexTypeValues = from SexType enumValue in Enum.GetValues(typeof(SexType))
select new { Value = Convert.ToInt32(enumValue), Text = L(string.Format("Enums.{0}.{1}", typeof(SexType).ToString().Split('.').Last(), enumValue.ToString())) };
output.SexTypes = sexTypeValues.Select(st => new ComboboxItemDto(st.Value.ToString(), st.Text.ToString()) { IsSelected = output.Student.Sex == st.Value }).ToList();
if (output.Student.UserId != null)
{
var user = await _userRepository.FirstOrDefaultAsync((long)output.Student.UserId);
output.UserName = user.Surname.ToString() + user.Name.ToString();
}
if (output.Student.TermId != null)
{
var term = await _termRepository.FirstOrDefaultAsync((long)output.Student.TermId);
output.TermName = term.Name.ToString();
}
if (output.Student.GradeId != null)
{
var grade = await _gradeRepository.FirstOrDefaultAsync((long)output.Student.GradeId);
output.GradeName = grade.Name.ToString();
}
if (output.Student.ClassId != null)
{
var theClass = await _classRepository.FirstOrDefaultAsync((long)output.Student.ClassId);
output.ClassName = theClass.Name.ToString();
}
if (output.Student.GetInTouchPathwayId != null)
{
var getInTouchPathway = await _getInTouchPathwayRepository.FirstOrDefaultAsync((long)output.Student.GetInTouchPathwayId);
output.GetInTouchPathwayName = getInTouchPathway.Name.ToString();
}
if (output.Student.DormitoryRoomId != null)
{
var dormitoryRoom = await _roomRepository.FirstOrDefaultAsync((long)output.Student.DormitoryRoomId);
output.DormitoryRoomName = dormitoryRoom.Name.ToString();
}
if (output.Student.BunkId != null)
{
var bunk = await _bunkRepository.FirstOrDefaultAsync((long)output.Student.BunkId);
output.BunkName = bunk.Name.ToString();
}
return output;
}
public async Task CreateOrEdit(CreateOrEditStudentDto input)
{
if(input.Id == null){
await Create(input);
}
else{
await Update(input);
}
}
[AbpAuthorize(AppPermissions.Pages_Students_Create)]
private async Task Create(CreateOrEditStudentDto input)
{
var student = ObjectMapper.Map<Student>(input);
if (AbpSession.TenantId != null)
{
student.TenantId = (int?) AbpSession.TenantId;
}
student.StudentGuid = Guid.NewGuid();
await _studentRepository.InsertAsync(student);
}
[AbpAuthorize(AppPermissions.Pages_Students_Edit)]
private async Task Update(CreateOrEditStudentDto input)
{
var student = await _studentRepository.FirstOrDefaultAsync((long)input.Id);
ObjectMapper.Map(input, student);
}
[AbpAuthorize(AppPermissions.Pages_Students_Delete)]
public async Task Delete(EntityDto<long> input)
{
await _studentRepository.DeleteAsync(input.Id);
}
public async Task<FileDto> GetStudentsToExcel(GetAllStudentsForExcelInput input)
{
var filteredStudents = _studentRepository.GetAll()
.WhereIf(!string.IsNullOrWhiteSpace(input.Filter), e => false || e.Name.Contains(input.Filter) || e.Surname.Contains(input.Filter) || e.PersonalName.Contains(input.Filter) || e.Number.Contains(input.Filter) || e.RegisteredResidence.Contains(input.Filter) || e.PhoneNumber.Contains(input.Filter) || e.IDNumber.Contains(input.Filter) || e.WeChat.Contains(input.Filter) || e.QQ.Contains(input.Filter) || e.FatherName.Contains(input.Filter) || e.FatherPhoneNumber.Contains(input.Filter) || e.FatherWeChat.Contains(input.Filter) || e.MotherName.Contains(input.Filter) || e.MotherPhoneNumber.Contains(input.Filter) || e.MotherWeChat.Contains(input.Filter) || e.ProfessionalCourseAppraisal.Contains(input.Filter) || e.LiteracyCourseAppraisal.Contains(input.Filter) || e.CustomAttributes.Contains(input.Filter))
.WhereIf(!string.IsNullOrWhiteSpace(input.StudentGuidFilter.ToString()), e => e.StudentGuid.ToString() == input.StudentGuidFilter.ToString().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.NameFilter), e => e.Name.ToLower() == input.NameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.SurnameFilter), e => e.Surname.ToLower() == input.SurnameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.PersonalNameFilter), e => e.PersonalName.ToLower() == input.PersonalNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.NumberFilter), e => e.Number.ToLower() == input.NumberFilter.ToLower().Trim())
.WhereIf(input.MinSexFilter != null, e => e.Sex >= input.MinSexFilter)
.WhereIf(input.MaxSexFilter != null, e => e.Sex <= input.MaxSexFilter)
.WhereIf(input.MinBirthdayFilter != null, e => e.Birthday >= input.MinBirthdayFilter)
.WhereIf(input.MaxBirthdayFilter != null, e => e.Birthday <= input.MaxBirthdayFilter)
.WhereIf(!string.IsNullOrWhiteSpace(input.RegisteredResidenceFilter), e => e.RegisteredResidence.ToLower() == input.RegisteredResidenceFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.PhoneNumberFilter), e => e.PhoneNumber.ToLower() == input.PhoneNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.IDNumberFilter), e => e.IDNumber.ToLower() == input.IDNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.WeChatFilter), e => e.WeChat.ToLower() == input.WeChatFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.QQFilter), e => e.QQ.ToLower() == input.QQFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.FatherNameFilter), e => e.FatherName.ToLower() == input.FatherNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.FatherPhoneNumberFilter), e => e.FatherPhoneNumber.ToLower() == input.FatherPhoneNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.FatherWeChatFilter), e => e.FatherWeChat.ToLower() == input.FatherWeChatFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.MotherNameFilter), e => e.MotherName.ToLower() == input.MotherNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.MotherPhoneNumberFilter), e => e.MotherPhoneNumber.ToLower() == input.MotherPhoneNumberFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.MotherWeChatFilter), e => e.MotherWeChat.ToLower() == input.MotherWeChatFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.ProfessionalCourseAppraisalFilter), e => e.ProfessionalCourseAppraisal.ToLower() == input.ProfessionalCourseAppraisalFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.LiteracyCourseAppraisalFilter), e => e.LiteracyCourseAppraisal.ToLower() == input.LiteracyCourseAppraisalFilter.ToLower().Trim());
var query = (from o in filteredStudents
join o1 in _userRepository.GetAll() on o.UserId equals o1.Id into j1
from s1 in j1.DefaultIfEmpty()
join o2 in _termRepository.GetAll() on o.TermId equals o2.Id into j2
from s2 in j2.DefaultIfEmpty()
join o3 in _gradeRepository.GetAll() on o.GradeId equals o3.Id into j3
from s3 in j3.DefaultIfEmpty()
join o4 in _classRepository.GetAll() on o.ClassId equals o4.Id into j4
from s4 in j4.DefaultIfEmpty()
join o5 in _getInTouchPathwayRepository.GetAll() on o.GetInTouchPathwayId equals o5.Id into j5
from s5 in j5.DefaultIfEmpty()
join o6 in _roomRepository.GetAll() on o.DormitoryRoomId.Value equals o6.Id into j6
from s6 in j6.DefaultIfEmpty()
select new GetStudentForView() {
Student = ObjectMapper.Map<StudentDto>(o),
UserName = s1 == null ? "" : s1.Name.ToString(),
TermName = s2 == null ? "" : s2.Name.ToString(),
GradeName = s3 == null ? "" : s3.Name.ToString(),
ClassName = s4 == null ? "" : s4.Name.ToString(),
GetInTouchPathwayName = s5 == null ? "" : s5.Name.ToString(),
SexTypeName = L(string.Format("Enums.{0}.{1}", typeof(SexType).ToString().Split('.', StringSplitOptions.RemoveEmptyEntries).Last(), o.SexType.ToString())),
DormitoryRoomName = s6 == null ? "" : s6.Name.ToString()
})
.WhereIf(!string.IsNullOrWhiteSpace(input.UserNameFilter), e => e.UserName.ToLower() == input.UserNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.TermNameFilter), e => e.TermName.ToLower() == input.TermNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.GradeNameFilter), e => e.GradeName.ToLower() == input.GradeNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.ClassNameFilter), e => e.ClassName.ToLower() == input.ClassNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.GetInTouchPathwayNameFilter), e => e.GetInTouchPathwayName.ToLower() == input.GetInTouchPathwayNameFilter.ToLower().Trim())
.WhereIf(!string.IsNullOrWhiteSpace(input.DormitoryRoomNameFilter), e => e.DormitoryRoomName.ToLower() == input.DormitoryRoomNameFilter.ToLower().Trim());
var StudentListDtos = await query.ToListAsync();
return _studentsExcelExporter.ExportToFile(StudentListDtos);
}
[AbpAuthorize(AppPermissions.Pages_Students)]
public async Task<PagedResultDto<UserLookupTableDto>> GetAllUserForLookupTable(GetAllForLookupTableInput input)
{
var query = _userRepository.GetAll().WhereIf(
!string.IsNullOrWhiteSpace(input.Filter),
e => (e.Surname.ToString() + e.Name.ToString()).Contains(input.Filter)
);
var totalCount = await query.CountAsync();
var userList = await query
.PageBy(input)
.ToListAsync();
var lookupTableDtoList = new List<UserLookupTableDto>();
foreach(var user in userList){
lookupTableDtoList.Add(new UserLookupTableDto
{
Id = user.Id,
DisplayName = user.Surname + user.Name.ToString()
});
}
return new PagedResultDto<UserLookupTableDto>(
totalCount,
lookupTableDtoList
);
}
[AbpAuthorize(AppPermissions.Pages_Students)]
public async Task<PagedResultDto<TermLookupTableDto>> GetAllTermForLookupTable(GetAllForLookupTableInput input)
{
var query = _termRepository.GetAll().WhereIf(
!string.IsNullOrWhiteSpace(input.Filter),
e=> e.Name.ToString().Contains(input.Filter)
);
var totalCount = await query.CountAsync();
var termList = await query
.PageBy(input)
.ToListAsync();
var lookupTableDtoList = new List<TermLookupTableDto>();
foreach(var term in termList){
lookupTableDtoList.Add(new TermLookupTableDto
{
Id = term.Id,
DisplayName = term.Name.ToString()
});
}
return new PagedResultDto<TermLookupTableDto>(
totalCount,
lookupTableDtoList
);
}
[AbpAuthorize(AppPermissions.Pages_Students)]
public async Task<PagedResultDto<GradeLookupTableDto>> GetAllGradeForLookupTable(GetAllForLookupTableInput input)
{
var query = _gradeRepository.GetAll().WhereIf(
!string.IsNullOrWhiteSpace(input.Filter),
e=> e.Name.ToString().Contains(input.Filter)
);
var totalCount = await query.CountAsync();
var gradeList = await query
.PageBy(input)
.ToListAsync();
var lookupTableDtoList = new List<GradeLookupTableDto>();
foreach(var grade in gradeList){
lookupTableDtoList.Add(new GradeLookupTableDto
{
Id = grade.Id,
DisplayName = grade.Name.ToString()
});
}
return new PagedResultDto<GradeLookupTableDto>(
totalCount,
lookupTableDtoList
);
}
[AbpAuthorize(AppPermissions.Pages_Students)]
public async Task<PagedResultDto<ClassLookupTableDto>> GetAllClassForLookupTable(GetAllForLookupTableInput input)
{
var query = _classRepository.GetAll().WhereIf(
!string.IsNullOrWhiteSpace(input.Filter),
e=> e.Name.ToString().Contains(input.Filter)
);
var totalCount = await query.CountAsync();
var classList = await query
.PageBy(input)
.ToListAsync();
var lookupTableDtoList = new List<ClassLookupTableDto>();
foreach(var theClass in classList){
lookupTableDtoList.Add(new ClassLookupTableDto
{
Id = theClass.Id,
DisplayName = theClass.Name.ToString()
});
}
return new PagedResultDto<ClassLookupTableDto>(
totalCount,
lookupTableDtoList
);
} [AbpAuthorize(AppPermissions.Pages_Students)]
public async Task<PagedResultDto<GetInTouchPathwayLookupTableDto>> GetAllGetInTouchPathwayForLookupTable(GetAllForLookupTableInput input)
{
var query = _getInTouchPathwayRepository.GetAll().WhereIf(
!string.IsNullOrWhiteSpace(input.Filter),
e=> e.Name.ToString().Contains(input.Filter)
);
var totalCount = await query.CountAsync();
var getInTouchPathwayList = await query
.PageBy(input)
.ToListAsync();
var lookupTableDtoList = new List<GetInTouchPathwayLookupTableDto>();
foreach(var getInTouchPathway in getInTouchPathwayList){
lookupTableDtoList.Add(new GetInTouchPathwayLookupTableDto
{
Id = getInTouchPathway.Id,
DisplayName = getInTouchPathway.Name.ToString()
});
}
return new PagedResultDto<GetInTouchPathwayLookupTableDto>(
totalCount,
lookupTableDtoList
);
}
}
Thanks for your guide, it could use the shortcut format the file, but it is not convenient. It will be better if this issue could be fixed.
<cite>aaron: </cite> Duplicate of #4298@fd3e905e-699e-4b51-8f24-043e930a1ccd
Thanks for your guide.
Version 5.0.4 core+jquery, encountered the same issue too.
Not yet, I have changed the notification publish mode, current I only publish the notification to the subscriber, not to a specified user. Using Abp Notification System.
Not any more AbpSession.ToUserIdentifier() being used, but I still could get the exception "current user not logged on the system" in log.
Any suggestions?
Is there a way that could do this on server side? Before, I set internal to call server method via JavaScript to get data to client, the user could always stayed as logged in. Now, I upgraded my application use SignalR broadcast data to client, and the current logged in user could get notifications if the broadcasted data with an exception, but after a duration, the user will logout automatically, then the user cannot get notifications any more, and logs also recorded some warning information that current user is not logged in the system. Exception like below:
ARN 2017-09-19 21:53:49,110 [71 ] ng.ESC.EquipmentStateCurrentCommunicator - Could not send Grading equipment current state to user
WARN 2017-09-19 21:53:49,126 [71 ] ng.ESC.EquipmentStateCurrentCommunicator - Abp.Authorization.AbpAuthorizationException: 当前用户没有登录到系统!
at Abp.Authorization.AuthorizationHelper.<AuthorizeAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AuthorizationHelper.<CheckPermissions>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AuthorizationHelper.<AuthorizeAsync>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at Nito.AsyncEx.AsyncContext.<>c__DisplayClass15_0.<Run>b__0(Task t)
at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at Nito.AsyncEx.AsyncContext.Run(Func`1 action)
at Abp.Authorization.AuthorizationHelperExtensions.Authorize(IAuthorizationHelper authorizationHelper, MethodInfo methodInfo, Type type)
at Abp.Authorization.AuthorizationInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Abp.Domain.Uow.UnitOfWorkInterceptor.PerformAsyncUow(IInvocation invocation, UnitOfWorkOptions options)
at Abp.Domain.Uow.UnitOfWorkInterceptor.PerformUow(IInvocation invocation, UnitOfWorkOptions options)
at Abp.Domain.Uow.UnitOfWorkInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Abp.Auditing.AuditingInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Abp.Runtime.Validation.Interception.ValidationInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.GradingEquipmentStateCurrentAppServiceProxy.GetEquipmentStateCurrent(GetGradingEquipmentStateCurrentInput input)
And, my code like below:
/// <summary>
/// Initializes a new instance of the <see cref="EquipmentStateCurrentHub"/> class.
/// </summary>
public EquipmentStateCurrentHub(
IEquipmentStateCurrentCommunicator equipmentStateCurrentCommunicator,
ILocalizationManager localizationManager)
{
_equipmentStateCurrentCommunicator = equipmentStateCurrentCommunicator;
_localizationManager = localizationManager;
Logger = NullLogger.Instance;
AbpSession = NullAbpSession.Instance;
}
public async Task<string> GetEquipmentCurentState(GetEquipmentStateCurrentByProcessStageInput input)
{
var user = AbpSession.ToUserIdentifier();
try
{
await _equipmentStateCurrentCommunicator.SendEquipmentCurrentStateToClient(input, user);
return string.Empty;
}
catch (UserFriendlyException ex)
{
Logger.Warn("Could not send CG conveyor equipment state to client: " + Context.ConnectionId);
Logger.Warn(ex.ToString(), ex);
return ex.Message;
}
catch (Exception ex)
{
Logger.Warn("Could not send CG conveyor equipment state to user: " + Context.ConnectionId);
Logger.Warn(ex.ToString(), ex);
return _localizationManager.GetSource("AbpWeb").GetString("InternalServerError");
}
I am using NullABPSession.Instance as a property injection to get AbpSession, is this way I can get the current login user?
Is there a way could set a long time expirations for AbpSession?
Thanks for your information.
Yes, I am running SingalR based on ABP.SingalR in .NET Core MVC on full .netframework 461.
It seems apply the hack is a little complicated and cannot been maintained via nugget package.
It is a little regretful that .net core mvc could not running SignalR full features.