Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit 27cb471

Browse files
davidfowlDamianEdwards
authored andcommitted
Made some tweaks to session2
1 parent e274471 commit 27cb471

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/2. Build out BackEnd and Refactor.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ We're also going to take this opportunity to rename the `Models` directory in th
193193
public class Session : ConferenceDTO.Session
194194
{
195195
public virtual ICollection<SessionSpeaker> SessionSpeakers { get; set; }
196+
197+
public virtual ICollection<SessionAttendee> SessionAttendees { get; set; }
196198

197199
public Track Track { get; set; }
198200
}
@@ -311,7 +313,6 @@ Okay, now we need to update our `ApplicationDbContext` so Entity Framework knows
311313
{
312314
public class SpeakerResponse : Speaker
313315
{
314-
// TODO: Set order of JSON properties so this shows up last not first
315316
public ICollection<Session> Sessions { get; set; } = new List<Session>();
316317
}
317318
}
@@ -394,15 +395,15 @@ Okay, now we need to update our `ApplicationDbContext` so Entity Framework knows
394395
1. Copy the `DataLoader.cs` class from [here](/src/BackEnd/Data/DataLoader.cs) into the `Data` directory of the `BackEnd` project.
395396
1. Copy the `SessionizeLoader.cs` and `DevIntersectionLoader.cs` classes from [here](/src/BackEnd/Data/) into the current project's `/src/BackEnd/Data/` directory.
396397
> Note: We have data loaders from the two conference series where this workshop has been presented most; you can update this to plug in your own conference file format.
397-
1. Turn enums as strings by changing `AddSwaggerGen` in `Startup.cs` to the following:
398-
```
398+
1. To improve the UI for upload, turn on the option to display enums as strings by changing `AddSwaggerGen` in `Startup.cs` to the following:
399+
```c#
399400
services.AddSwaggerGen(options =>
400401
{
401402
options.SwaggerDoc("v1", new OpenApiInfo { Title = "Conference Planner API", Version = "v1" });
402403
options.DescribeAllEnumsAsStrings();
403404
});
404405
```
405406
1. Run the application to see the updated data via Swagger UI.
406-
1. Use the Swagger UI to upload [NDC_London_2019.json](/src/BackEnd/Data/Import/NDC_London_2019.json) to the `/api/Conferences/upload` API.
407+
1. Use the Swagger UI to upload [NDC_Oslo_2019.json](/src/BackEnd/Data/Import/NDC_Oslo_2019.json) to the `/api/Sessions/upload` API.
407408

408409
**Next**: [Session #3 - Front-end](3.%20Add%20front-end%2C%20render%20agenda%2C%20set%20up%20front-end%20models.md) | **Previous**: [Session #1 - Setup, basic EF model](/docs/1.%20Create%20BackEnd%20API%20project.md)

0 commit comments

Comments
 (0)