This commit is contained in:
@@ -31,6 +31,8 @@ namespace Ewide.Core.WebApi
|
||||
// 500
|
||||
config.Services.Replace(typeof(IHttpActionInvoker), new HttpWebApiControllerActionInvoker(config));
|
||||
#endregion
|
||||
|
||||
config.Filters.Add(new ValidateArgumentsFilter());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ using System.Web.Http;
|
||||
|
||||
namespace Ewide.Core.WebApi.Areas.Base.Controllers
|
||||
{
|
||||
[ValidateArgumentsFilter]
|
||||
public class GateController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
@@ -16,10 +15,15 @@ namespace Ewide.Core.WebApi.Areas.Base.Controllers
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
[ValidateArgumentsFilter(AllowNull = true)]
|
||||
public IHttpActionResult Login(LoginDTO dto)
|
||||
{
|
||||
return DisplayJSON(dto);
|
||||
}
|
||||
|
||||
[ValidateArgumentsFilter(AllowNull = true)]
|
||||
public IHttpActionResult AllowNullAPI(LoginDTO dto)
|
||||
{
|
||||
return DisplayJSON(dto);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ using System.Web.Http.Filters;
|
||||
|
||||
namespace Ewide.Core.WebApi
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple = false)]
|
||||
public class ValidateArgumentsFilter : ActionFilterAttribute
|
||||
{
|
||||
public bool AllowNull { get; set; } = false;
|
||||
|
||||
Reference in New Issue
Block a user