There is no session (and no user) in a background job.
Ideally, avoid using app service in background job in the first place.
// AsyncHelper.RunSync(() => _tripsAppService.CreateOrEdit(...));
AsyncHelper.RunSync(() => _tripsManager.CreateOrEdit(...));
Otherwise, you can pass UserIdentifier
to your background job and then override current session values:
using (AbpSession.Use(args.User.TenantId, args.User.UserId))
{
AsyncHelper.RunSync(() => _tripsAppService.CreateOrEdit(...));
}
It is like any other Git project.
For step-by-step, refer to aspnetzero/aspnet-zero#96 (comment-268093697).
Can you retrieve and check the value?
Set AbpZeroSettingNames.UserManagement.PasswordComplexity.RequiredLength
using ISettingManager
.
Duplicate of aspnetzero/aspnet-zero-core#2422.
Try upgrading to v7.1.0+.
I was mistaken about [(ngModel)]
.
ASP<span></span>.NET Zero v7.2.0+ implements datePickerMomentModifier
directive. Try this:
- [(ngModel)]="pssaleh.docDate.toDate()"
+ datePickerMomentModifier
+ [(date)]="pssaleh.docDate"
That seems unrelated. Can you show the full line?
What's the error now?
Try .toDate()
instead: [(ngModel)]="pssaleh.docDate.toDate()"
From https://momentjs.com/guides/#/lib-concepts/internal-properties:
As such, the values of
_d
and any other properties prefixed with_
should not be used for any purpose.To print out the value of a Moment, use
.format()
,.toString()
or.toISOString()
.To retrieve a native Date object from Moment, use
.toDate()
. This function returns a properly shifted date for interaction with third party APIs.