private static APIGatewayProxyResponse CreateTimelineEvent(APIGatewayProxyRequest request)
        {
            Log("Create Timeline Request recieved");
            var timelineEventRequest = RequestHelper.ParsePutRequestBody <CreateTimelineEventRequest>(request);

            Log($"Request parsed {timelineEventRequest}");
            ValidateTimelineEventId(timelineEventRequest.TimelineEventId);
            ValidateTimelineEventTitle(timelineEventRequest.Title);
            ValidateTimelineEventDateTime(timelineEventRequest.EventDateTime);
            Log($"Request Validation passed");

            var model = new TimelineEventModel
            {
                Id            = timelineEventRequest.TimelineEventId,
                Title         = timelineEventRequest.Title,
                EventDateTime = timelineEventRequest.EventDateTime,
                Description   = timelineEventRequest.Description,
                Location      = timelineEventRequest.Location
            };

            Log($"Getting repo");
            GetRepo(timelineEventRequest.TenantId).CreateTimlineEvent(model);

            Log($"Wrapping response");
            return(ResponseHelper.WrapResponse(model));
        }
Exemplo n.º 2
0
 public void SaveTimelineEventModel(TimelineEventModel model)
 {
     model.TenantId = TenantId;
     Context.SaveAsync(model).Wait();
 }
Exemplo n.º 3
0
 public void CreateTimlineEvent(TimelineEventModel model)
 {
     Console.WriteLine($"Creating timeline event for Id:{model.Id}");
     model.TenantId = TenantId;
     Context.SaveAsync(model).Wait();
 }