i am working in one project related space booking.booked a space based on day/week/month with different price.
i have created one class for calculate price either or like allow only hourly/day booking,some space avail for only day/month booking and some space allow for day/week and month and vice...
I have created one Background service that execute after every 5 minutes and this service used for sending email after 6 hour,24 hour and 48 hour for user booking order is not confirmed.
for that i have created below method and enums.
public enum Enum_AbandonedCartEmailNotifyHour
{
...
and if i create different extension method like you suggested public static async Task LogUserWarning(this EventLogger logger, DateTimeOffset eventTriggeredOn, string eventName, string message) { // ... }
and for savechanges for log i have used await UnitOfWork.SaveChangesAsync(); that call my unit of work and save dbcontext it this good way to every log method call and call savechanges in database?
"Do not use System.Web.HttpContext.Current directly" then for get ip address i need to pass parameter in log() method right? and pass this ip value from calling method
for log event i have used every time await EventLogger.Log(DateTimeOffset.Now, Enum_EventType.Update, "Update Listing", Enum_LogType.Information, "Completed", listing.ID.ToString());