**@webking **
It was a bit of a manual process, but my upgrade was done by:
All told it was about a full days' work.
@ismcagdas I do, yes. Which I think is the expected behavior, based on https://aspnetboilerplate.com/Pages/Documents/MVC-Controllers#exception-handling-result-wrapping if I'm reading it correctly. I just wasn't sure if ASPNZ had something baked in that already handled this sort of overriding, or if I need to homebrew something.
@robrechtbelien , have you looked at background tasks to accomplish this? See https://aspnetboilerplate.com/Pages/Documents/Background-Jobs-And-Workers You can add a BackgroundJob at any time, you would just need to calculate offset from Clock.Now until the start of your event, minus 5 minutes. I am doing something similar in my app.
Take a look at **Abp.BackgroundJobs.BackgroundJobManager, EnqueueAsync() method: **
[UnitOfWork]
public virtual async Task<string> EnqueueAsync<TJob, TArgs>(TArgs args, BackgroundJobPriority priority = BackgroundJobPriority.Normal, TimeSpan? delay = null)
where TJob : IBackgroundJob<TArgs>
{
var jobInfo = new BackgroundJobInfo
{
JobType = typeof(TJob).AssemblyQualifiedName,
JobArgs = args.ToJsonString(),
Priority = priority
};
if (delay.HasValue)
{
jobInfo.NextTryTime = Clock.Now.Add(delay.Value);
}
await _store.InsertAsync(jobInfo);
await CurrentUnitOfWork.SaveChangesAsync();
return jobInfo.Id.ToString();
}
Have you re-run npm run create-bundles
?
What does console.log(data);
show? At first glance your code looks correct, as I'mdoing something similar, however, what is your Create() method returning? You may also want to try just returning a number right away (skip all your logic), to see if it's a problem with your return value or your javascript to help with troubleshooting
I ran into a similar problem using UTC as my clockProvider on the server side. The resolution I found was, before submitting from client side to server side for processing, you need to specify the format of the datetime object.
Below is jQuery but gives you the idea:
$('.datetime-picker').datetimepicker({
minDate: new Date(),
locale: abp.localization.currentLanguage.name,
format: 'L LT'
});
to render you Datetime field selector to your end user. Before posting to server:
var formattedDate = $("#Notification_AutoBroadcastDate").data("DateTimePicker").date().format("YYYY-MM-DDTHH:mmZ");
and return formattedDate to your server for processing, which will include the timezone offset.
If you do not include the timezone offset when submitting to server, it is assumed to be a UTC date.
@ryancyq not sure why I never thought to do a simple association. That works quite nicely, thanks for the feedback. I ended up creating an Xyz entity with IMustHaveTenant enforced, linked to an XyzOU derived class and doing tenantId validation one save
Looks to have been opened by @KevinFarrow already, https://github.com/aspnetzero/aspnet-zero-core/issues/2402