Skip to content
This repository was archived by the owner on Dec 11, 2020. It is now read-only.

Commit d2d651c

Browse files
Updated convention to fix issue with update not working correctly
1 parent 8bdc0c8 commit d2d651c

1 file changed

Lines changed: 24 additions & 15 deletions

File tree

src/MediatR.AspNetCore/MediatorApiConventions.cs

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public static void Delete(
2525
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Any)]
2626
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.AssignableFrom)]
2727
IRequest<object> request
28-
) { }
28+
)
29+
{ }
2930
#endregion
3031

3132
#region OTHER
@@ -38,7 +39,8 @@ public static void Other(
3839
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Any)]
3940
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.AssignableFrom)]
4041
IRequest<object> request
41-
) { }
42+
)
43+
{ }
4244
#endregion
4345

4446
#region GET
@@ -52,7 +54,8 @@ public static void Get(
5254
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Any)]
5355
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.AssignableFrom)]
5456
IRequest<object> model
55-
) { }
57+
)
58+
{ }
5659

5760
[ProducesResponseType(StatusCodes.Status200OK)]
5861
[ProducesResponseType(StatusCodes.Status404NotFound)]
@@ -64,7 +67,8 @@ public static void Find(
6467
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Any)]
6568
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.AssignableFrom)]
6669
IRequest<object> model
67-
) { }
70+
)
71+
{ }
6872
#endregion
6973

7074
#region POST
@@ -78,7 +82,8 @@ public static void Post(
7882
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Any)]
7983
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.AssignableFrom)]
8084
IRequest<object> model
81-
) { }
85+
)
86+
{ }
8287

8388
[ProducesResponseType(StatusCodes.Status201Created)]
8489
[ProducesResponseType(StatusCodes.Status404NotFound)]
@@ -90,7 +95,8 @@ public static void Create(
9095
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Any)]
9196
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.AssignableFrom)]
9297
IRequest<object> model
93-
) { }
98+
)
99+
{ }
94100
#endregion
95101

96102
#region PUT
@@ -105,9 +111,10 @@ public static void Put(
105111
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)]
106112
object id,
107113
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Any)]
108-
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.AssignableFrom)]
109-
IRequest<object> model
110-
) { }
114+
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)]
115+
object model
116+
)
117+
{ }
111118

112119
[ProducesResponseType(StatusCodes.Status204NoContent)]
113120
[ProducesResponseType(StatusCodes.Status404NotFound)]
@@ -120,9 +127,10 @@ public static void Edit(
120127
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)]
121128
object id,
122129
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Any)]
123-
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.AssignableFrom)]
124-
IRequest<object> model
125-
) { }
130+
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)]
131+
object model
132+
)
133+
{ }
126134

127135
[ProducesResponseType(StatusCodes.Status204NoContent)]
128136
[ProducesResponseType(StatusCodes.Status404NotFound)]
@@ -135,9 +143,10 @@ public static void Update(
135143
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)]
136144
object id,
137145
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Any)]
138-
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.AssignableFrom)]
139-
IRequest<object> model
140-
) { }
146+
[ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)]
147+
object model
148+
)
149+
{ }
141150
#endregion
142151
}
143152
}

0 commit comments

Comments
 (0)