Skip to content

Commit 1c877e2

Browse files
committed
Release Candidate 1
1 parent 2c59738 commit 1c877e2

File tree

126 files changed

+34950
-4448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+34950
-4448
lines changed

.github/workflows/azure-static-web-apps-white-sea-0edb66d0f.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

Books.csproj

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp3.1</TargetFramework>
4-
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
3+
<TargetFramework>net5.0</TargetFramework>
54
</PropertyGroup>
65

76
<ItemGroup>
8-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.11" />
9-
<!--<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.3" />-->
7+
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.3" />
8+
<PackageReference Include="MongoDB.Bson" Version="2.12.0" />
109
<PackageReference Include="MongoDB.Driver" Version="2.11.6" />
11-
<!--<PackageReference Include="Newtonsoft.json" Version="12.0.3" />
12-
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />-->
13-
</ItemGroup>
14-
<ItemGroup>
15-
<None Update="host.json">
16-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
17-
</None>
18-
<None Update="local.settings.json">
19-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
20-
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
21-
</None>
10+
<PackageReference Include="Newtonsoft.json" Version="12.0.3" />
11+
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
2212
</ItemGroup>
2313
</Project>

api/Controllers/BooksController.cs.bak renamed to api/Controllers/BookController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ namespace Books.Api.Controllers
77

88
[Route("api/[controller]")]
99
[ApiController]
10-
public class BooksController : ControllerBase
10+
public class BookController : ControllerBase
1111
{
1212
private readonly BookService _bookService;
1313

14-
public BooksController(BookService bookService)
14+
public BookController(BookService bookService)
1515
{
1616
_bookService = bookService;
1717
}

api/Controllers/GroupController.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
namespace Books.Api.Controllers
2+
{
3+
using Microsoft.AspNetCore.Mvc;
4+
using System.Collections.Generic;
5+
6+
using Books.Api.Models;
7+
using Books.Api.Services;
8+
9+
[Route("api/[controller]")]
10+
[ApiController]
11+
public class GroupController : ControllerBase
12+
{
13+
private readonly GroupService _groupService;
14+
15+
public GroupController(GroupService groupService)
16+
{
17+
_groupService = groupService;
18+
}
19+
20+
[HttpGet]
21+
public ActionResult<List<Models.Group>> Get() =>
22+
_groupService.Get();
23+
24+
[HttpGet("{id:length(36)}", Name = "GetUserGroups")]
25+
public ActionResult<List<Models.Group>> Get(string id)
26+
{
27+
var groups = _groupService.Get(id);
28+
29+
if (groups == null)
30+
{
31+
return NotFound();
32+
}
33+
34+
return groups;
35+
}
36+
}
37+
}

api/CreateBook.cs

Whitespace-only changes.

api/DeleteBook.cs

Whitespace-only changes.

api/GetBooks.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

api/Models/BookstoreDatabaseSettings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ namespace Books.Api.Models
33
public class BookstoreDatabaseSettings : IBookstoreDatabaseSettings
44
{
55
public string BooksCollectionName { get; set; }
6+
public string GroupsCollectionName { get; set; }
67
public string ConnectionString { get; set; }
78
public string DatabaseName { get; set; }
89
}
910

1011
public interface IBookstoreDatabaseSettings
1112
{
1213
string BooksCollectionName { get; set; }
14+
string GroupsCollectionName { get;set; }
1315
string ConnectionString { get; set; }
1416
string DatabaseName { get; set; }
1517
}

api/Models/Group.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace Books.Api.Models
2+
{
3+
using MongoDB.Bson;
4+
using MongoDB.Bson.Serialization.Attributes;
5+
6+
using Newtonsoft.Json;
7+
8+
public class Group
9+
{
10+
[BsonId]
11+
[BsonRepresentation(BsonType.ObjectId)]
12+
public string Id { get; set; }
13+
14+
public string AzId {get; set; }
15+
16+
public string GroupName { get; set; }
17+
}
18+
}
File renamed without changes.

0 commit comments

Comments
 (0)