ikyriak / IdempotentAPI

A .NET library that handles the HTTP write operations (POST and PATCH) that can affect only once for the given request data and idempotency-key by using an ASP.NET Core attribute (filter).
MIT License
284 stars 40 forks source link

I made a demo that can't run #14

Closed apchenjun closed 3 years ago

apchenjun commented 3 years ago

I created a web api project and run the console to report an error

        [HttpPost("Create")]
        [Idempotent()]
        public async Task<IActionResult> Create(WeatherForecastModel weatherForecastDto)
        {
            return new JsonResult(weatherForecastDto.Summary);
        }
       [Serializable]
       public class WeatherForecastModel
      {
        public string Summary { get; set; }
      }

I use postman to simulate the request image

image Can the author make a demo that uses IdempotentAPI to simulate multiple repeated submissions that cannot be successful?

ikyriak commented 3 years ago

@apchenjun Thank you for reporting this issue. I have reproduced and fixed it. You can download the updated version (v0.2.0-beta) of the library. I have also uploaded a sample project (using .NET Core 3.1).