-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
be92580
commit fb3018d
Showing
6 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
samples/datasync-server/src/Sample.Datasync.Server/Controllers/TodoListController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using CommunityToolkit.Datasync.Server; | ||
using CommunityToolkit.Datasync.Server.EntityFrameworkCore; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Sample.Datasync.Server.Db; | ||
|
||
namespace Sample.Datasync.Server.Controllers; | ||
|
||
[Route("tables/[controller]")] | ||
public class TodoListController : TableController<TodoList> | ||
{ | ||
public TodoListController(AppDbContext context) : base(new EntityTableRepository<TodoList>(context)) | ||
{ | ||
Options = new TableControllerOptions { EnableSoftDelete = true }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
samples/datasync-server/src/Sample.Datasync.Server/Db/TodoList.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using CommunityToolkit.Datasync.Server.EntityFrameworkCore; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace Sample.Datasync.Server.Db; | ||
|
||
public class TodoList : EntityTableData | ||
{ | ||
[Required, MinLength(1)] | ||
public string Title { get; set; } = string.Empty; | ||
|
||
public string? ListId { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,6 @@ | |
} | ||
}, | ||
"Swagger": { | ||
"Driver": "NSwag" | ||
"Driver": "Swashbuckle" | ||
} | ||
} |