I have an enitity where the user specifies a time of day to notify employees in a work shift.
They set the time, for example, 7:30 AM.
The DateTime kind of the field I get on save is UTC. So I think I'm doing this correctly.
I used the TimeZone dropdown to let them pick the time zone for shift.
When the view model comes down, the time is in UTC.
Would I do better to modify the view objects and put the time for the selected time zone on that, use that in the views, then, on save, convert that with moment to the UTC property when posting back?
Or -
Would I do better to modify the view model and convert it to the time zone for the entity, and then convert it back when I save?
Am I doing this correctly in all my projects' startup.cs?
app.UseAbp(options =>
{
Clock.Provider = ClockProviders.Utc;
options.UseAbpRequestLocalization = false; //used below: UseAbpRequestLocalization
});
Yes.
It calls ClearForm, which sets the entity back to the model. If the user hits save again it creates two entities.
I need a worker to do multitenant work on the database - so in the DoWork function I would like to use the DB context.
The worker class lives the Core project.
The reason is I need to to linq queries involving datetimes and these don't work through reposities.
my linq looks like this:
allShifts = allShifts
.Where(s =>
TimeSpan.Compare(s.Deadline.ToUniversalTime().AddHours(s.NotifyHoursBeforeDeadline * -1).TimeOfDay, _notificationSweep.TimeOfDay) < 0 // The deadline is after now
&&
_notificationSweep.TimeOfDay.TotalMinutes - s.Deadline.ToUniversalTime().AddHours(s.NotifyHoursBeforeDeadline * -1).TimeOfDay.TotalMinutes < NotificationWindowInMinutes + 5 // it's within 30 minutes, adding 5 minutes to account for sending time
)
.ToList();
If I can get to the workDbContext, I should be able to use some of the dbFunctions specified here: https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.sqlserverdbfunctionsextensions?view=efcore-3.1
What this is trying to do:
I have a datetime object I only need the timeofday - so I have now which is the notificationsweep variable.
I need to get time of day values that are within 30 minutes of the job running.
My hope is geting the DB context would allow better querying flexibilty.
I'm going to mark this resolved. I've got a fairly good deployment going. I'm using GoCD + a powershell build script and it's doing a great job.
I really want to go to azure - and I know it can be cheap to start - but the pricing calculator seems to be a black art.
I'm curious what real world looks like? 50 users?
Heavy API usage?
I've reviewed: https://aspnetboilerplate.com/Pages/Documents/Navigation, that doesn't really answer my question
I've crawled through abp.nav.menus.App - and I can see the menu items there.
What I can't figure out is how to, once an entity is saved, go back to the entities main menu item.
How is that done?
Understood - What I was asking is if I have an entity where I need to note what time zone it exists in, how do I set it as a property.
I'm currently using a string, and the name of the time zone.
That seems to be how ABP does it.
Currently, I check in my branch, regenerate, then go through the changes to move my modifications into the updated files.
Is this the best way? What do other people do?
is there a easier, faster way?
I have entites that have start and stop times.
Do I store the time zone as a string? timeZoneId?