public static ReminderModel ToModel(this ReminderTableEntity reminder) { return(new ReminderModel() { Hour = reminder.RowKey, // CreatedTime = reminder.CreatedTime, Message = reminder.Message }); }
public static IActionResult GetReminderByHour( [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "reminder/{hour}")] HttpRequest req, [Table("reminders", Mappings.PartitionKey, "{hour}", Connection = "AzureWebJobsStorage")] ReminderTableEntity reminder, ILogger log, string hour) { if (reminder == null) { log.LogInformation($"Get reminder not found for hour {hour}"); return(new NotFoundResult()); } log.LogInformation($"Getting reminder found by {hour} with message {reminder.Message}"); return(new OkObjectResult(reminder.ToModel())); }