示例#1
0
 public static ReminderModel ToModel(this ReminderTableEntity reminder)
 {
     return(new ReminderModel()
     {
         Hour = reminder.RowKey,
         // CreatedTime = reminder.CreatedTime,
         Message = reminder.Message
     });
 }
示例#2
0
        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()));
        }