Created
October 27, 2018 04:49
-
-
Save PandiyanCool/b71690451d6e8945d260f6e11043d359 to your computer and use it in GitHub Desktop.
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
using Microsoft.AspNetCore.Mvc.ApiExplorer; | |
namespace Microsoft.AspNetCore.Mvc | |
{ | |
public static class DefaultApiConventions | |
{ | |
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Prefix)] | |
[ProducesDefaultResponseType] | |
[ProducesResponseType(201)] | |
[ProducesResponseType(400)] | |
public static void Create([ApiConventionNameMatch(ApiConventionNameMatchBehavior.Any)][ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)] object model); | |
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Prefix)] | |
[ProducesDefaultResponseType] | |
[ProducesResponseType(200)] | |
[ProducesResponseType(404)] | |
[ProducesResponseType(400)] | |
public static void Delete([ApiConventionNameMatch(ApiConventionNameMatchBehavior.Suffix)][ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)] object id); | |
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Prefix)] | |
[ProducesDefaultResponseType] | |
[ProducesResponseType(204)] | |
[ProducesResponseType(404)] | |
[ProducesResponseType(400)] | |
public static void Edit([ApiConventionNameMatch(ApiConventionNameMatchBehavior.Suffix)][ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)] object id, [ApiConventionNameMatch(ApiConventionNameMatchBehavior.Any)][ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)] object model); | |
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Prefix)] | |
[ProducesDefaultResponseType] | |
[ProducesResponseType(200)] | |
[ProducesResponseType(404)] | |
public static void Find([ApiConventionNameMatch(ApiConventionNameMatchBehavior.Suffix)][ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)] object id); | |
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Prefix)] | |
[ProducesDefaultResponseType] | |
[ProducesResponseType(200)] | |
[ProducesResponseType(404)] | |
public static void Get([ApiConventionNameMatch(ApiConventionNameMatchBehavior.Suffix)][ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)] object id); | |
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Prefix)] | |
[ProducesDefaultResponseType] | |
[ProducesResponseType(201)] | |
[ProducesResponseType(400)] | |
public static void Post([ApiConventionNameMatch(ApiConventionNameMatchBehavior.Any)][ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)] object model); | |
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Prefix)] | |
[ProducesDefaultResponseType] | |
[ProducesResponseType(204)] | |
[ProducesResponseType(404)] | |
[ProducesResponseType(400)] | |
public static void Put([ApiConventionNameMatch(ApiConventionNameMatchBehavior.Suffix)][ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)] object id, [ApiConventionNameMatch(ApiConventionNameMatchBehavior.Any)][ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)] object model); | |
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Prefix)] | |
[ProducesDefaultResponseType] | |
[ProducesResponseType(204)] | |
[ProducesResponseType(404)] | |
[ProducesResponseType(400)] | |
public static void Update([ApiConventionNameMatch(ApiConventionNameMatchBehavior.Suffix)][ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)] object id, [ApiConventionNameMatch(ApiConventionNameMatchBehavior.Any)][ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)] object model); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment