├── .gitignore
├── .vscode
├── launch.json
└── tasks.json
├── AsyncProductAPI.csproj
├── Data
└── AppDbContext.cs
├── Dtos
└── ListingStatus.cs
├── Migrations
├── 20230205192946_initialmigration.Designer.cs
├── 20230205192946_initialmigration.cs
└── AppDbContextModelSnapshot.cs
├── Models
└── ListingRequest.cs
├── Program.cs
├── Properties
└── launchSettings.json
├── appsettings.Development.json
└── appsettings.json
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Ll]og/
33 | [Ll]ogs/
34 |
35 | # Visual Studio 2015/2017 cache/options directory
36 | .vs/
37 | # Uncomment if you have tasks that create the project's static files in wwwroot
38 | #wwwroot/
39 |
40 | # Visual Studio 2017 auto generated files
41 | Generated\ Files/
42 |
43 | # MSTest test Results
44 | [Tt]est[Rr]esult*/
45 | [Bb]uild[Ll]og.*
46 |
47 | # NUnit
48 | *.VisualState.xml
49 | TestResult.xml
50 | nunit-*.xml
51 |
52 | # Build Results of an ATL Project
53 | [Dd]ebugPS/
54 | [Rr]eleasePS/
55 | dlldata.c
56 |
57 | # Benchmark Results
58 | BenchmarkDotNet.Artifacts/
59 |
60 | # .NET
61 | project.lock.json
62 | project.fragment.lock.json
63 | artifacts/
64 |
65 | # Tye
66 | .tye/
67 |
68 | # ASP.NET Scaffolding
69 | ScaffoldingReadMe.txt
70 |
71 | # StyleCop
72 | StyleCopReport.xml
73 |
74 | # Files built by Visual Studio
75 | *_i.c
76 | *_p.c
77 | *_h.h
78 | *.ilk
79 | *.meta
80 | *.obj
81 | *.iobj
82 | *.pch
83 | *.pdb
84 | *.ipdb
85 | *.pgc
86 | *.pgd
87 | *.rsp
88 | *.sbr
89 | *.tlb
90 | *.tli
91 | *.tlh
92 | *.tmp
93 | *.tmp_proj
94 | *_wpftmp.csproj
95 | *.log
96 | *.vspscc
97 | *.vssscc
98 | .builds
99 | *.pidb
100 | *.svclog
101 | *.scc
102 |
103 | # Chutzpah Test files
104 | _Chutzpah*
105 |
106 | # Visual C++ cache files
107 | ipch/
108 | *.aps
109 | *.ncb
110 | *.opendb
111 | *.opensdf
112 | *.sdf
113 | *.cachefile
114 | *.VC.db
115 | *.VC.VC.opendb
116 |
117 | # Visual Studio profiler
118 | *.psess
119 | *.vsp
120 | *.vspx
121 | *.sap
122 |
123 | # Visual Studio Trace Files
124 | *.e2e
125 |
126 | # TFS 2012 Local Workspace
127 | $tf/
128 |
129 | # Guidance Automation Toolkit
130 | *.gpState
131 |
132 | # ReSharper is a .NET coding add-in
133 | _ReSharper*/
134 | *.[Rr]e[Ss]harper
135 | *.DotSettings.user
136 |
137 | # TeamCity is a build add-in
138 | _TeamCity*
139 |
140 | # DotCover is a Code Coverage Tool
141 | *.dotCover
142 |
143 | # AxoCover is a Code Coverage Tool
144 | .axoCover/*
145 | !.axoCover/settings.json
146 |
147 | # Coverlet is a free, cross platform Code Coverage Tool
148 | coverage*.json
149 | coverage*.xml
150 | coverage*.info
151 |
152 | # Visual Studio code coverage results
153 | *.coverage
154 | *.coveragexml
155 |
156 | # NCrunch
157 | _NCrunch_*
158 | .*crunch*.local.xml
159 | nCrunchTemp_*
160 |
161 | # MightyMoose
162 | *.mm.*
163 | AutoTest.Net/
164 |
165 | # Web workbench (sass)
166 | .sass-cache/
167 |
168 | # Installshield output folder
169 | [Ee]xpress/
170 |
171 | # DocProject is a documentation generator add-in
172 | DocProject/buildhelp/
173 | DocProject/Help/*.HxT
174 | DocProject/Help/*.HxC
175 | DocProject/Help/*.hhc
176 | DocProject/Help/*.hhk
177 | DocProject/Help/*.hhp
178 | DocProject/Help/Html2
179 | DocProject/Help/html
180 |
181 | # Click-Once directory
182 | publish/
183 |
184 | # Publish Web Output
185 | *.[Pp]ublish.xml
186 | *.azurePubxml
187 | # Note: Comment the next line if you want to checkin your web deploy settings,
188 | # but database connection strings (with potential passwords) will be unencrypted
189 | *.pubxml
190 | *.publishproj
191 |
192 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
193 | # checkin your Azure Web App publish settings, but sensitive information contained
194 | # in these scripts will be unencrypted
195 | PublishScripts/
196 |
197 | # NuGet Packages
198 | *.nupkg
199 | # NuGet Symbol Packages
200 | *.snupkg
201 | # The packages folder can be ignored because of Package Restore
202 | **/[Pp]ackages/*
203 | # except build/, which is used as an MSBuild target.
204 | !**/[Pp]ackages/build/
205 | # Uncomment if necessary however generally it will be regenerated when needed
206 | #!**/[Pp]ackages/repositories.config
207 | # NuGet v3's project.json files produces more ignorable files
208 | *.nuget.props
209 | *.nuget.targets
210 |
211 | # Microsoft Azure Build Output
212 | csx/
213 | *.build.csdef
214 |
215 | # Microsoft Azure Emulator
216 | ecf/
217 | rcf/
218 |
219 | # Windows Store app package directories and files
220 | AppPackages/
221 | BundleArtifacts/
222 | Package.StoreAssociation.xml
223 | _pkginfo.txt
224 | *.appx
225 | *.appxbundle
226 | *.appxupload
227 |
228 | # Visual Studio cache files
229 | # files ending in .cache can be ignored
230 | *.[Cc]ache
231 | # but keep track of directories ending in .cache
232 | !?*.[Cc]ache/
233 |
234 | # Others
235 | ClientBin/
236 | ~$*
237 | *~
238 | *.dbmdl
239 | *.dbproj.schemaview
240 | *.jfm
241 | *.pfx
242 | *.publishsettings
243 | orleans.codegen.cs
244 | *.db
245 | *.db-shm
246 | *.db-wal
247 |
248 | # Including strong name files can present a security risk
249 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
250 | #*.snk
251 |
252 | # Since there are multiple workflows, uncomment next line to ignore bower_components
253 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
254 | #bower_components/
255 |
256 | # RIA/Silverlight projects
257 | Generated_Code/
258 |
259 | # Backup & report files from converting an old project file
260 | # to a newer Visual Studio version. Backup files are not needed,
261 | # because we have git ;-)
262 | _UpgradeReport_Files/
263 | Backup*/
264 | UpgradeLog*.XML
265 | UpgradeLog*.htm
266 | ServiceFabricBackup/
267 | *.rptproj.bak
268 |
269 | # SQL Server files
270 | *.mdf
271 | *.ldf
272 | *.ndf
273 |
274 | # Business Intelligence projects
275 | *.rdl.data
276 | *.bim.layout
277 | *.bim_*.settings
278 | *.rptproj.rsuser
279 | *- [Bb]ackup.rdl
280 | *- [Bb]ackup ([0-9]).rdl
281 | *- [Bb]ackup ([0-9][0-9]).rdl
282 |
283 | # Microsoft Fakes
284 | FakesAssemblies/
285 |
286 | # GhostDoc plugin setting file
287 | *.GhostDoc.xml
288 |
289 | # Node.js Tools for Visual Studio
290 | .ntvs_analysis.dat
291 | node_modules/
292 |
293 | # Visual Studio 6 build log
294 | *.plg
295 |
296 | # Visual Studio 6 workspace options file
297 | *.opt
298 |
299 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
300 | *.vbw
301 |
302 | # Visual Studio LightSwitch build output
303 | **/*.HTMLClient/GeneratedArtifacts
304 | **/*.DesktopClient/GeneratedArtifacts
305 | **/*.DesktopClient/ModelManifest.xml
306 | **/*.Server/GeneratedArtifacts
307 | **/*.Server/ModelManifest.xml
308 | _Pvt_Extensions
309 |
310 | # Paket dependency manager
311 | .paket/paket.exe
312 | paket-files/
313 |
314 | # FAKE - F# Make
315 | .fake/
316 |
317 | # CodeRush personal settings
318 | .cr/personal
319 |
320 | # Python Tools for Visual Studio (PTVS)
321 | __pycache__/
322 | *.pyc
323 |
324 | # Cake - Uncomment if you are using it
325 | # tools/**
326 | # !tools/packages.config
327 |
328 | # Tabs Studio
329 | *.tss
330 |
331 | # Telerik's JustMock configuration file
332 | *.jmconfig
333 |
334 | # BizTalk build output
335 | *.btp.cs
336 | *.btm.cs
337 | *.odx.cs
338 | *.xsd.cs
339 |
340 | # OpenCover UI analysis results
341 | OpenCover/
342 |
343 | # Azure Stream Analytics local run output
344 | ASALocalRun/
345 |
346 | # MSBuild Binary and Structured Log
347 | *.binlog
348 |
349 | # NVidia Nsight GPU debugger configuration file
350 | *.nvuser
351 |
352 | # MFractors (Xamarin productivity tool) working folder
353 | .mfractor/
354 |
355 | # Local History for Visual Studio
356 | .localhistory/
357 |
358 | # BeatPulse healthcheck temp database
359 | healthchecksdb
360 |
361 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
362 | MigrationBackup/
363 |
364 | # Ionide (cross platform F# VS Code tools) working folder
365 | .ionide/
366 |
367 | # Fody - auto-generated XML schema
368 | FodyWeavers.xsd
369 |
370 | ##
371 | ## Visual studio for Mac
372 | ##
373 |
374 |
375 | # globs
376 | Makefile.in
377 | *.userprefs
378 | *.usertasks
379 | config.make
380 | config.status
381 | aclocal.m4
382 | install-sh
383 | autom4te.cache/
384 | *.tar.gz
385 | tarballs/
386 | test-results/
387 |
388 | # Mac bundle stuff
389 | *.dmg
390 | *.app
391 |
392 | # content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
393 | # General
394 | .DS_Store
395 | .AppleDouble
396 | .LSOverride
397 |
398 | # Icon must end with two \r
399 | Icon
400 |
401 |
402 | # Thumbnails
403 | ._*
404 |
405 | # Files that might appear in the root of a volume
406 | .DocumentRevisions-V100
407 | .fseventsd
408 | .Spotlight-V100
409 | .TemporaryItems
410 | .Trashes
411 | .VolumeIcon.icns
412 | .com.apple.timemachine.donotpresent
413 |
414 | # Directories potentially created on remote AFP share
415 | .AppleDB
416 | .AppleDesktop
417 | Network Trash Folder
418 | Temporary Items
419 | .apdisk
420 |
421 | # content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
422 | # Windows thumbnail cache files
423 | Thumbs.db
424 | ehthumbs.db
425 | ehthumbs_vista.db
426 |
427 | # Dump file
428 | *.stackdump
429 |
430 | # Folder config file
431 | [Dd]esktop.ini
432 |
433 | # Recycle Bin used on file shares
434 | $RECYCLE.BIN/
435 |
436 | # Windows Installer files
437 | *.cab
438 | *.msi
439 | *.msix
440 | *.msm
441 | *.msp
442 |
443 | # Windows shortcuts
444 | *.lnk
445 |
446 | # JetBrains Rider
447 | .idea/
448 | *.sln.iml
449 |
450 | ##
451 | ## Visual Studio Code
452 | ##
453 | .vscode/*
454 | !.vscode/settings.json
455 | !.vscode/tasks.json
456 | !.vscode/launch.json
457 | !.vscode/extensions.json
458 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | // Use IntelliSense to find out which attributes exist for C# debugging
6 | // Use hover for the description of the existing attributes
7 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
8 | "name": ".NET Core Launch (web)",
9 | "type": "coreclr",
10 | "request": "launch",
11 | "preLaunchTask": "build",
12 | // If you have changed target frameworks, make sure to update the program path.
13 | "program": "${workspaceFolder}/bin/Debug/net6.0/AsyncProductAPI.dll",
14 | "args": [],
15 | "cwd": "${workspaceFolder}",
16 | "stopAtEntry": false,
17 | // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
18 | "serverReadyAction": {
19 | "action": "openExternally",
20 | "pattern": "\\bNow listening on:\\s+(https?://\\S+)"
21 | },
22 | "env": {
23 | "ASPNETCORE_ENVIRONMENT": "Development"
24 | },
25 | "sourceFileMap": {
26 | "/Views": "${workspaceFolder}/Views"
27 | }
28 | },
29 | {
30 | "name": ".NET Core Attach",
31 | "type": "coreclr",
32 | "request": "attach"
33 | }
34 | ]
35 | }
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build",
6 | "command": "dotnet",
7 | "type": "process",
8 | "args": [
9 | "build",
10 | "${workspaceFolder}/AsyncProductAPI.csproj",
11 | "/property:GenerateFullPaths=true",
12 | "/consoleloggerparameters:NoSummary"
13 | ],
14 | "problemMatcher": "$msCompile"
15 | },
16 | {
17 | "label": "publish",
18 | "command": "dotnet",
19 | "type": "process",
20 | "args": [
21 | "publish",
22 | "${workspaceFolder}/AsyncProductAPI.csproj",
23 | "/property:GenerateFullPaths=true",
24 | "/consoleloggerparameters:NoSummary"
25 | ],
26 | "problemMatcher": "$msCompile"
27 | },
28 | {
29 | "label": "watch",
30 | "command": "dotnet",
31 | "type": "process",
32 | "args": [
33 | "watch",
34 | "run",
35 | "--project",
36 | "${workspaceFolder}/AsyncProductAPI.csproj"
37 | ],
38 | "problemMatcher": "$msCompile"
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/AsyncProductAPI.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | runtime; build; native; contentfiles; analyzers; buildtransitive
16 | all
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Data/AppDbContext.cs:
--------------------------------------------------------------------------------
1 | using AsyncProductAPI.Models;
2 | using Microsoft.EntityFrameworkCore;
3 |
4 | namespace AsyncProductAPI.Data
5 | {
6 | public class AppDbContext : DbContext
7 | {
8 | public AppDbContext(DbContextOptions options) : base(options)
9 | {
10 |
11 | }
12 |
13 | public DbSet ListingRequests => Set();
14 | }
15 | }
--------------------------------------------------------------------------------
/Dtos/ListingStatus.cs:
--------------------------------------------------------------------------------
1 | namespace AsyncProductAPI.Dtos
2 | {
3 | public class ListingStatus
4 | {
5 | public string? RequestStatus { get; set; }
6 |
7 | public string? EstimatedCompetionTime { get; set; }
8 |
9 | public string? ResourceURL { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/Migrations/20230205192946_initialmigration.Designer.cs:
--------------------------------------------------------------------------------
1 | //
2 | using AsyncProductAPI.Data;
3 | using Microsoft.EntityFrameworkCore;
4 | using Microsoft.EntityFrameworkCore.Infrastructure;
5 | using Microsoft.EntityFrameworkCore.Migrations;
6 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
7 |
8 | #nullable disable
9 |
10 | namespace AsyncProductAPI.Migrations
11 | {
12 | [DbContext(typeof(AppDbContext))]
13 | [Migration("20230205192946_initialmigration")]
14 | partial class initialmigration
15 | {
16 | ///
17 | protected override void BuildTargetModel(ModelBuilder modelBuilder)
18 | {
19 | #pragma warning disable 612, 618
20 | modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
21 |
22 | modelBuilder.Entity("AsyncProductAPI.Models.ListingRequest", b =>
23 | {
24 | b.Property("Id")
25 | .ValueGeneratedOnAdd()
26 | .HasColumnType("INTEGER");
27 |
28 | b.Property("EstimatedCompetionTime")
29 | .HasColumnType("TEXT");
30 |
31 | b.Property("RequestBody")
32 | .HasColumnType("TEXT");
33 |
34 | b.Property("RequestId")
35 | .IsRequired()
36 | .HasColumnType("TEXT");
37 |
38 | b.Property("RequestStatus")
39 | .HasColumnType("TEXT");
40 |
41 | b.HasKey("Id");
42 |
43 | b.ToTable("ListingRequests");
44 | });
45 | #pragma warning restore 612, 618
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Migrations/20230205192946_initialmigration.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Migrations;
2 |
3 | #nullable disable
4 |
5 | namespace AsyncProductAPI.Migrations
6 | {
7 | ///
8 | public partial class initialmigration : Migration
9 | {
10 | ///
11 | protected override void Up(MigrationBuilder migrationBuilder)
12 | {
13 | migrationBuilder.CreateTable(
14 | name: "ListingRequests",
15 | columns: table => new
16 | {
17 | Id = table.Column(type: "INTEGER", nullable: false)
18 | .Annotation("Sqlite:Autoincrement", true),
19 | RequestBody = table.Column(type: "TEXT", nullable: true),
20 | EstimatedCompetionTime = table.Column(type: "TEXT", nullable: true),
21 | RequestStatus = table.Column(type: "TEXT", nullable: true),
22 | RequestId = table.Column(type: "TEXT", nullable: false)
23 | },
24 | constraints: table =>
25 | {
26 | table.PrimaryKey("PK_ListingRequests", x => x.Id);
27 | });
28 | }
29 |
30 | ///
31 | protected override void Down(MigrationBuilder migrationBuilder)
32 | {
33 | migrationBuilder.DropTable(
34 | name: "ListingRequests");
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Migrations/AppDbContextModelSnapshot.cs:
--------------------------------------------------------------------------------
1 | //
2 | using AsyncProductAPI.Data;
3 | using Microsoft.EntityFrameworkCore;
4 | using Microsoft.EntityFrameworkCore.Infrastructure;
5 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
6 |
7 | #nullable disable
8 |
9 | namespace AsyncProductAPI.Migrations
10 | {
11 | [DbContext(typeof(AppDbContext))]
12 | partial class AppDbContextModelSnapshot : ModelSnapshot
13 | {
14 | protected override void BuildModel(ModelBuilder modelBuilder)
15 | {
16 | #pragma warning disable 612, 618
17 | modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
18 |
19 | modelBuilder.Entity("AsyncProductAPI.Models.ListingRequest", b =>
20 | {
21 | b.Property("Id")
22 | .ValueGeneratedOnAdd()
23 | .HasColumnType("INTEGER");
24 |
25 | b.Property("EstimatedCompetionTime")
26 | .HasColumnType("TEXT");
27 |
28 | b.Property("RequestBody")
29 | .HasColumnType("TEXT");
30 |
31 | b.Property("RequestId")
32 | .IsRequired()
33 | .HasColumnType("TEXT");
34 |
35 | b.Property("RequestStatus")
36 | .HasColumnType("TEXT");
37 |
38 | b.HasKey("Id");
39 |
40 | b.ToTable("ListingRequests");
41 | });
42 | #pragma warning restore 612, 618
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Models/ListingRequest.cs:
--------------------------------------------------------------------------------
1 | namespace AsyncProductAPI.Models
2 | {
3 | public class ListingRequest
4 | {
5 | public int Id { get; set; }
6 |
7 | public string? RequestBody { get; set; }
8 |
9 | public string? EstimatedCompetionTime { get; set; }
10 |
11 | public string? RequestStatus { get; set; }
12 |
13 | public string RequestId { get; set; } = Guid.NewGuid().ToString();
14 | }
15 | }
--------------------------------------------------------------------------------
/Program.cs:
--------------------------------------------------------------------------------
1 | using AsyncProductAPI.Data;
2 | using AsyncProductAPI.Dtos;
3 | using AsyncProductAPI.Models;
4 | using Microsoft.EntityFrameworkCore;
5 |
6 | var builder = WebApplication.CreateBuilder(args);
7 |
8 | builder.Services.AddDbContext(opt => opt.UseSqlite("Data Source=RequestDB.db"));
9 |
10 | var app = builder.Build();
11 |
12 | app.UseHttpsRedirection();
13 |
14 | // Start Endpoint
15 | app.MapPost("api/v1/products", async (AppDbContext context, ListingRequest listingRequest) =>{
16 | if(listingRequest == null)
17 | return Results.BadRequest();
18 |
19 | listingRequest.RequestStatus = "ACCEPT";
20 | listingRequest.EstimatedCompetionTime = "2023-02-06:14:00:00";
21 |
22 | await context.ListingRequests.AddAsync(listingRequest);
23 | await context.SaveChangesAsync();
24 |
25 | return Results.Accepted($"api/v1/productstatus/{listingRequest.RequestId}", listingRequest);
26 |
27 | });
28 |
29 | // Status endpoint
30 |
31 | app.MapGet("api/v1/productstatus/{requestId}", (AppDbContext context, string requestId) => {
32 | var listingRequest = context.ListingRequests.FirstOrDefault(lr => lr.RequestId == requestId);
33 |
34 | if(listingRequest == null)
35 | return Results.NotFound();
36 |
37 | ListingStatus listingStatus = new ListingStatus{
38 | RequestStatus = listingRequest.RequestStatus,
39 | ResourceURL = String.Empty
40 | };
41 |
42 | if(listingRequest.RequestStatus!.ToUpper() == "COMPLETE")
43 | {
44 | listingStatus.ResourceURL = $"api/v1/products/{Guid.NewGuid().ToString()}";
45 | //return Results.Ok(listingStatus);
46 |
47 | return Results.Redirect("https://localhost:7076/" + listingStatus.ResourceURL);
48 | }
49 |
50 | listingStatus.EstimatedCompetionTime = "2023-02-06:15:00:00";
51 | return Results.Ok(listingStatus);
52 |
53 | });
54 |
55 | // Final Endpoint
56 |
57 | app.MapGet("api/v1/products/{requestId}", (string requestId) =>
58 | {
59 | return Results.Ok("This is where you would pass back the final result");
60 | });
61 |
62 | app.Run();
63 |
64 |
--------------------------------------------------------------------------------
/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/launchsettings.json",
3 | "iisSettings": {
4 | "windowsAuthentication": false,
5 | "anonymousAuthentication": true,
6 | "iisExpress": {
7 | "applicationUrl": "http://localhost:21354",
8 | "sslPort": 44303
9 | }
10 | },
11 | "profiles": {
12 | "AsyncProductAPI": {
13 | "commandName": "Project",
14 | "dotnetRunMessages": true,
15 | "applicationUrl": "https://localhost:7076;http://localhost:5169",
16 | "environmentVariables": {
17 | "ASPNETCORE_ENVIRONMENT": "Development"
18 | }
19 | },
20 | "IIS Express": {
21 | "commandName": "IISExpress",
22 | "environmentVariables": {
23 | "ASPNETCORE_ENVIRONMENT": "Development"
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*"
9 | }
10 |
--------------------------------------------------------------------------------