diff --git a/Demo/Startup.cs b/Demo/Startup.cs index 4402ac8..b5d83bd 100644 --- a/Demo/Startup.cs +++ b/Demo/Startup.cs @@ -74,6 +74,7 @@ namespace Demo services.AddPoweredSoftGraphQLFluentValidation(); services.AddSwaggerGen(); + services.AddCors(); } private void AddDynamicQueries(IServiceCollection services) @@ -113,6 +114,8 @@ namespace Demo app.UseHttpsRedirection(); + app.UseCors(o => o.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod()); + app.UseRouting(); app.UseAuthorization(); diff --git a/PoweredSoft.CQRS.AspNetCore/Mvc/CommandController.cs b/PoweredSoft.CQRS.AspNetCore/Mvc/CommandController.cs index 7901ca3..2cabc11 100644 --- a/PoweredSoft.CQRS.AspNetCore/Mvc/CommandController.cs +++ b/PoweredSoft.CQRS.AspNetCore/Mvc/CommandController.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; namespace PoweredSoft.CQRS.AspNetCore.Mvc { + [Produces("application/json")] [ApiController, Route("api/command/[controller]")] public class CommandController : Controller where TCommand : class @@ -23,6 +24,7 @@ namespace PoweredSoft.CQRS.AspNetCore.Mvc } } + [Produces("application/json")] [ApiController, Route("api/command/[controller]")] public class CommandController : Controller where TCommand : class diff --git a/PoweredSoft.CQRS.AspNetCore/Mvc/QueryController.cs b/PoweredSoft.CQRS.AspNetCore/Mvc/QueryController.cs index 24b8f6e..2302315 100644 --- a/PoweredSoft.CQRS.AspNetCore/Mvc/QueryController.cs +++ b/PoweredSoft.CQRS.AspNetCore/Mvc/QueryController.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; namespace PoweredSoft.CQRS.AspNetCore.Mvc { + [Produces("application/json")] [ApiController, Route("api/query/[controller]")] public class QueryController : Controller where TQuery : class