Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CleanArchitecture
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CleanArchitecture
Commits
4cc75800
Commit
4cc75800
authored
Feb 08, 2020
by
Steve Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add file nesting
parent
b371971d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
29 deletions
+33
-29
ToDoItemsController.cs
src/CleanArchitecture.Web/Api/ToDoItemsController.cs
+0
-1
CreateEndpoint.CreateCommand.cs
...e.Web/Endpoints/ToDoItems/CreateEndpoint.CreateCommand.cs
+12
-0
CreateEndpoint.CreatedResult.cs
...e.Web/Endpoints/ToDoItems/CreateEndpoint.CreatedResult.cs
+8
-0
CreateEndpoint.cs
...eanArchitecture.Web/Endpoints/ToDoItems/CreateEndpoint.cs
+0
-15
ListEndpoint.ListItemResult.cs
...re.Web/Endpoints/ToDoItems/ListEndpoint.ListItemResult.cs
+10
-0
ListEndpoint.cs
...CleanArchitecture.Web/Endpoints/ToDoItems/ListEndpoint.cs
+3
-13
No files found.
src/CleanArchitecture.Web/Api/ToDoItemsController.cs
View file @
4cc75800
using
CleanArchitecture.Core.Entities
;
using
CleanArchitecture.SharedKernel.Interfaces
;
using
CleanArchitecture.Web.ApiModels
;
using
CleanArchitecture.Web.Filters
;
using
Microsoft.AspNetCore.Mvc
;
using
System.Linq
;
...
...
src/CleanArchitecture.Web/Endpoints/ToDoItems/CreateEndpoint.CreateCommand.cs
0 → 100644
View file @
4cc75800
using
System.ComponentModel.DataAnnotations
;
namespace
CleanArchitecture.Web.Endpoints.ToDoItems
{
public
class
CreateCommand
{
[
Required
]
public
string
Title
{
get
;
set
;
}
[
Required
]
public
string
Description
{
get
;
set
;
}
}
}
src/CleanArchitecture.Web/Endpoints/ToDoItems/CreateEndpoint.CreatedResult.cs
0 → 100644
View file @
4cc75800
namespace
CleanArchitecture.Web.Endpoints.ToDoItems
{
public
class
CreatedResult
:
CreateCommand
{
public
int
Id
{
get
;
set
;
}
}
}
src/CleanArchitecture.Web/Endpoints/ToDoItems/CreateEndpoint.cs
View file @
4cc75800
using
CleanArchitecture.Core.Entities
;
using
CleanArchitecture.SharedKernel.Interfaces
;
using
Microsoft.AspNetCore.Mvc
;
using
System.ComponentModel.DataAnnotations
;
namespace
CleanArchitecture.Web.Endpoints.ToDoItems
{
...
...
@@ -34,18 +33,4 @@ namespace CleanArchitecture.Web.Endpoints.ToDoItems
}
}
// Imagine these are separate classes attached to the Handler/Endpoint with + expansion in VS
public
class
CreateCommand
{
[
Required
]
public
string
Title
{
get
;
set
;
}
[
Required
]
public
string
Description
{
get
;
set
;
}
}
public
class
CreatedResult
:
CreateCommand
{
public
int
Id
{
get
;
set
;
}
}
}
src/CleanArchitecture.Web/Endpoints/ToDoItems/ListEndpoint.ListItemResult.cs
0 → 100644
View file @
4cc75800
namespace
CleanArchitecture.Web.Endpoints.ToDoItems
{
public
class
ListItemResult
{
public
int
Id
{
get
;
set
;
}
public
string
Title
{
get
;
set
;
}
public
string
Description
{
get
;
set
;
}
}
}
src/CleanArchitecture.Web/Endpoints/ToDoItems/ListEndpoint.cs
View file @
4cc75800
...
...
@@ -2,12 +2,11 @@
using
CleanArchitecture.SharedKernel.Interfaces
;
using
Microsoft.AspNetCore.Mvc
;
using
System.Collections.Generic
;
using
System.ComponentModel.DataAnnotations
;
using
System.Linq
;
namespace
CleanArchitecture.Web.Endpoints.ToDoItems
{
public
class
ListEndpoint
:
BaseEndpoint
<
List
<
ToDo
ItemResult
>>
public
class
ListEndpoint
:
BaseEndpoint
<
List
<
List
ItemResult
>>
{
private
readonly
IRepository
_repository
;
...
...
@@ -17,10 +16,10 @@ namespace CleanArchitecture.Web.Endpoints.ToDoItems
}
[
HttpGet
(
"/endpoints/items"
)]
public
override
ActionResult
<
List
<
ToDo
ItemResult
>>
Handle
()
public
override
ActionResult
<
List
<
List
ItemResult
>>
Handle
()
{
var
result
=
_repository
.
List
<
ToDoItem
>()
.
Select
(
i
=>
new
ToDo
ItemResult
.
Select
(
i
=>
new
List
ItemResult
{
Id
=
i
.
Id
,
Title
=
i
.
Title
,
...
...
@@ -29,13 +28,4 @@ namespace CleanArchitecture.Web.Endpoints.ToDoItems
return
Ok
(
result
);
}
}
// Imagine these are separate classes attached to the Handler/Endpoint with + expansion in VS
public
class
ToDoItemResult
{
public
int
Id
{
get
;
set
;
}
public
string
Title
{
get
;
set
;
}
public
string
Description
{
get
;
set
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment