├── .vs ├── WebAPICustomActionFilter │ └── v15 │ │ ├── .suo │ │ └── sqlite3 │ │ └── storage.ide └── config │ └── applicationhost.config ├── README.md ├── WebAPICustomActionFilter.sln ├── WebAPICustomActionFilter.v12.suo ├── WebAPICustomActionFilter ├── App_Start │ └── WebApiConfig.cs ├── Controllers │ └── HomeController.cs ├── ExecutionTimeFilterAttribute.cs ├── FilterOrder │ ├── CustomFilter1.cs │ ├── CustomFilter2.cs │ ├── CustomFilter3.cs │ ├── IOrderFilter.cs │ └── OrderedFilterProvider.cs ├── Global.asax ├── Global.asax.cs ├── Properties │ └── AssemblyInfo.cs ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── WebAPICustomActionFilter.csproj ├── WebAPICustomActionFilter.csproj.user ├── bin │ ├── Newtonsoft.Json.dll │ ├── Newtonsoft.Json.xml │ ├── System.Net.Http.Formatting.dll │ ├── System.Net.Http.Formatting.xml │ ├── System.Web.Http.WebHost.dll │ ├── System.Web.Http.WebHost.xml │ ├── System.Web.Http.dll │ ├── System.Web.Http.xml │ ├── WebAPICustomActionFilter.dll │ ├── WebAPICustomActionFilter.dll.config │ └── WebAPICustomActionFilter.pdb ├── obj │ └── Debug │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs │ │ ├── WebAPICustomActionFilter.csproj.CopyComplete │ │ ├── WebAPICustomActionFilter.csproj.CoreCompileInputs.cache │ │ ├── WebAPICustomActionFilter.csproj.FileListAbsolute.txt │ │ ├── WebAPICustomActionFilter.csprojResolveAssemblyReference.cache │ │ ├── WebAPICustomActionFilter.dll │ │ └── WebAPICustomActionFilter.pdb └── packages.config └── packages ├── Microsoft.AspNet.WebApi.5.2.2 └── Microsoft.AspNet.WebApi.5.2.2.nupkg ├── Microsoft.AspNet.WebApi.Client.5.2.2 ├── Microsoft.AspNet.WebApi.Client.5.2.2.nupkg └── lib │ ├── net45 │ ├── System.Net.Http.Formatting.dll │ └── System.Net.Http.Formatting.xml │ └── portable-wp8%2Bnetcore45%2Bnet45%2Bwp81%2Bwpa81 │ ├── System.Net.Http.Formatting.dll │ └── System.Net.Http.Formatting.xml ├── Microsoft.AspNet.WebApi.Core.5.2.2 ├── Content │ └── web.config.transform ├── Microsoft.AspNet.WebApi.Core.5.2.2.nupkg └── lib │ └── net45 │ ├── System.Web.Http.dll │ └── System.Web.Http.xml ├── Microsoft.AspNet.WebApi.WebHost.5.2.2 ├── Microsoft.AspNet.WebApi.WebHost.5.2.2.nupkg └── lib │ └── net45 │ ├── System.Web.Http.WebHost.dll │ └── System.Web.Http.WebHost.xml ├── Newtonsoft.Json.6.0.4 ├── Newtonsoft.Json.6.0.4.nupkg ├── lib │ ├── net20 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ ├── net35 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ ├── net40 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ ├── net45 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ ├── netcore45 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ ├── portable-net40%2Bsl5%2Bwp80%2Bwin8%2Bwpa81 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml │ └── portable-net45%2Bwp80%2Bwin8%2Bwpa81 │ │ ├── Newtonsoft.Json.dll │ │ └── Newtonsoft.Json.xml └── tools │ └── install.ps1 └── repositories.config /.vs/WebAPICustomActionFilter/v15/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/.vs/WebAPICustomActionFilter/v15/.suo -------------------------------------------------------------------------------- /.vs/WebAPICustomActionFilter/v15/sqlite3/storage.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/.vs/WebAPICustomActionFilter/v15/sqlite3/storage.ide -------------------------------------------------------------------------------- /.vs/config/applicationhost.config: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 49 | 50 | 51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | 60 | 61 | 62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | 81 |
82 |
83 | 84 |
85 |
86 |
87 |
88 |
89 |
90 | 91 |
92 |
93 |
94 |
95 |
96 | 97 |
98 |
99 |
100 | 101 |
102 |
103 | 104 |
105 |
106 | 107 |
108 |
109 |
110 | 111 | 112 |
113 |
114 |
115 |
116 |
117 |
118 | 119 |
120 |
121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | 994 | 995 | 996 | 997 | 998 | 999 | 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WebAPI-CustomActionFilter 2 | 3 | https://www.c-sharpcorner.com/UploadFile/db2972/trace-web-api-execution-time-using-custom-action-filter/ 4 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.31101.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebAPICustomActionFilter", "WebAPICustomActionFilter\WebAPICustomActionFilter.csproj", "{8449E7AA-21AB-452F-9508-43F9E91DD3CB}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {8449E7AA-21AB-452F-9508-43F9E91DD3CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {8449E7AA-21AB-452F-9508-43F9E91DD3CB}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {8449E7AA-21AB-452F-9508-43F9E91DD3CB}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {8449E7AA-21AB-452F-9508-43F9E91DD3CB}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter.v12.suo -------------------------------------------------------------------------------- /WebAPICustomActionFilter/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web.Http; 5 | 6 | namespace WebAPICustomActionFilter 7 | { 8 | public static class WebApiConfig 9 | { 10 | public static void Register(HttpConfiguration config) 11 | { 12 | // Web API configuration and services 13 | 14 | // Web API routes 15 | config.MapHttpAttributeRoutes(); 16 | 17 | config.Routes.MapHttpRoute( 18 | name: "DefaultApi", 19 | routeTemplate: "api/{controller}/{id}", 20 | defaults: new { id = RouteParameter.Optional } 21 | ); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Net.Http; 6 | using System.Web.Http; 7 | 8 | namespace WebAPICustomActionFilter.Controllers 9 | { 10 | public class HomeController : ApiController 11 | { 12 | // GET: api/Home 13 | [CustomFilter1(Sequence =3)] 14 | [CustomFilter2(Sequence = 2)] 15 | [CustomFilter3(Sequence = 1)] 16 | public IEnumerable Get() 17 | { 18 | return new string[] { "value1", "value2" }; 19 | } 20 | 21 | // GET: api/Home/5 22 | public string Get(int id) 23 | { 24 | return "value"; 25 | } 26 | 27 | // POST: api/Home 28 | public void Post([FromBody]string value) 29 | { 30 | } 31 | 32 | // PUT: api/Home/5 33 | public void Put(int id, [FromBody]string value) 34 | { 35 | } 36 | 37 | // DELETE: api/Home/5 38 | public void Delete(int id) 39 | { 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/ExecutionTimeFilterAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Web.Http.Filters; 8 | 9 | namespace WebAPICustomActionFilter 10 | { 11 | class ExecutionTimeFilterAttribute : ActionFilterAttribute 12 | { 13 | public override void OnActionExecuting(System.Web.Http.Controllers.HttpActionContext actionContext) 14 | { 15 | base.OnActionExecuting(actionContext); 16 | actionContext.Request.Properties[actionContext.ActionDescriptor.ActionName] = Stopwatch.StartNew(); 17 | } 18 | 19 | public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) 20 | { 21 | base.OnActionExecuted(actionExecutedContext); 22 | Stopwatch stopwatch = (Stopwatch)actionExecutedContext.Request.Properties[actionExecutedContext.ActionContext.ActionDescriptor.ActionName]; 23 | Trace.WriteLine(actionExecutedContext.ActionContext.ActionDescriptor.ActionName + "-Elapsed = " + stopwatch.Elapsed); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/FilterOrder/CustomFilter1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Web; 6 | using System.Web.Http.Filters; 7 | 8 | namespace WebAPICustomActionFilter 9 | { 10 | class CustomFilter1 : ActionFilterWithOrderAttribute 11 | { 12 | public override void OnActionExecuting(System.Web.Http.Controllers.HttpActionContext actionContext) 13 | { 14 | Trace.WriteLine("OnActionExecuting1"); 15 | } 16 | 17 | public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) 18 | { 19 | Trace.WriteLine("OnActionExecuted1"); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /WebAPICustomActionFilter/FilterOrder/CustomFilter2.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Web; 6 | using System.Web.Http.Filters; 7 | 8 | namespace WebAPICustomActionFilter 9 | { 10 | public class CustomFilter2 : ActionFilterWithOrderAttribute 11 | { 12 | public override void OnActionExecuting(System.Web.Http.Controllers.HttpActionContext actionContext) 13 | { 14 | Trace.WriteLine("OnActionExecuting2"); 15 | } 16 | 17 | public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) 18 | { 19 | Trace.WriteLine("OnActionExecuted2"); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /WebAPICustomActionFilter/FilterOrder/CustomFilter3.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Web; 6 | using System.Web.Http.Filters; 7 | 8 | namespace WebAPICustomActionFilter 9 | { 10 | public class CustomFilter3 : ActionFilterWithOrderAttribute 11 | { 12 | public override void OnActionExecuting(System.Web.Http.Controllers.HttpActionContext actionContext) 13 | { 14 | Trace.WriteLine("OnActionExecuting3"); 15 | } 16 | 17 | public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) 18 | { 19 | Trace.WriteLine("OnActionExecuted3"); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /WebAPICustomActionFilter/FilterOrder/IOrderFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Web.Http.Filters; 7 | 8 | namespace WebAPICustomActionFilter 9 | { 10 | public interface ISequenceFilter : IFilter 11 | { 12 | int Sequence { get; set; } 13 | } 14 | 15 | public class ActionFilterWithOrderAttribute : ActionFilterAttribute, ISequenceFilter 16 | { 17 | public int Sequence { get; set; } 18 | } 19 | 20 | public class AuthorizationFilterWithOrderAttribute : AuthorizationFilterAttribute, ISequenceFilter 21 | { 22 | public int Sequence { get; set; } 23 | } 24 | 25 | public class ExceptionFilterWithOrderAttribute : ExceptionFilterAttribute, ISequenceFilter 26 | { 27 | public int Sequence { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/FilterOrder/OrderedFilterProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Http; 6 | using System.Web.Http.Controllers; 7 | using System.Web.Http.Filters; 8 | 9 | namespace WebAPICustomActionFilter 10 | { 11 | public class SequenceFilterProvider : IFilterProvider 12 | { 13 | public IEnumerable GetFilters(HttpConfiguration configuration, HttpActionDescriptor actionDescriptor) 14 | { 15 | var controllerSpecificFilters = SequenceFilters(actionDescriptor.ControllerDescriptor.GetFilters(), FilterScope.Controller); 16 | 17 | var actionSpecificFilters = SequenceFilters(actionDescriptor.GetFilters(), FilterScope.Action); 18 | 19 | return controllerSpecificFilters.Concat(actionSpecificFilters); 20 | } 21 | 22 | private IEnumerable SequenceFilters(IEnumerable filters, FilterScope scope) 23 | { 24 | var notOrderableFilter = filters.Where(f => !(f is ISequenceFilter)) 25 | .Select(instance => new KeyValuePair(0, new FilterInfo(instance, scope))); 26 | 27 | var orderableFilter = filters.OfType().OrderBy(filter => filter.Sequence) 28 | .Select(instance => new KeyValuePair(instance.Sequence, new FilterInfo(instance, scope))); 29 | 30 | return notOrderableFilter.Concat(orderableFilter).OrderBy(x => x.Key).Select(y => y.Value); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /WebAPICustomActionFilter/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="WebAPICustomActionFilter.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Http; 6 | using System.Web.Http.Filters; 7 | using System.Web.Routing; 8 | 9 | namespace WebAPICustomActionFilter 10 | { 11 | public class WebApiApplication : System.Web.HttpApplication 12 | { 13 | protected void Application_Start() 14 | { 15 | GlobalConfiguration.Configure(WebApiConfig.Register); 16 | 17 | var config = GlobalConfiguration.Configuration; 18 | //config.Filters.Add(new ExecutionTimeFilterAttribute()); 19 | 20 | config.Services.Replace(typeof(IFilterProvider), new System.Web.Http.Filters.ConfigurationFilterProvider()); 21 | config.Services.Add(typeof(IFilterProvider), new SequenceFilterProvider()); 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("WebAPICustomActionFilter")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("WebAPICustomActionFilter")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e4fa55b8-cdc6-4d3c-8ce4-d9df1bac24cd")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/WebAPICustomActionFilter.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 8 | 9 | 2.0 10 | {8449E7AA-21AB-452F-9508-43F9E91DD3CB} 11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 12 | Library 13 | Properties 14 | WebAPICustomActionFilter 15 | WebAPICustomActionFilter 16 | v4.5.1 17 | true 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | true 27 | full 28 | false 29 | bin\ 30 | DEBUG;TRACE 31 | prompt 32 | 4 33 | 34 | 35 | pdbonly 36 | true 37 | bin\ 38 | TRACE 39 | prompt 40 | 4 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll 65 | 66 | 67 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.2\lib\net45\System.Net.Http.Formatting.dll 68 | 69 | 70 | ..\packages\Microsoft.AspNet.WebApi.Core.5.2.2\lib\net45\System.Web.Http.dll 71 | 72 | 73 | ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.2\lib\net45\System.Web.Http.WebHost.dll 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | Global.asax 91 | 92 | 93 | 94 | 95 | 96 | 97 | Web.config 98 | 99 | 100 | Web.config 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 10.0 109 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | True 119 | True 120 | 33229 121 | / 122 | http://localhost:33229/ 123 | False 124 | False 125 | 126 | 127 | False 128 | 129 | 130 | 131 | 132 | 139 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/WebAPICustomActionFilter.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 600 5 | True 6 | False 7 | True 8 | 9 | False 10 | true 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | CurrentPage 25 | True 26 | False 27 | False 28 | False 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | True 38 | True 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/bin/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter/bin/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /WebAPICustomActionFilter/bin/System.Net.Http.Formatting.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter/bin/System.Net.Http.Formatting.dll -------------------------------------------------------------------------------- /WebAPICustomActionFilter/bin/System.Web.Http.WebHost.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter/bin/System.Web.Http.WebHost.dll -------------------------------------------------------------------------------- /WebAPICustomActionFilter/bin/System.Web.Http.WebHost.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | System.Web.Http.WebHost 5 | 6 | 7 | 8 | Provides a global for ASP.NET applications. 9 | 10 | 11 | 12 | 13 | 14 | Gets the global . 15 | 16 | 17 | Extension methods for 18 | 19 | 20 | Maps the specified route template. 21 | A reference to the mapped route. 22 | A collection of routes for the application. 23 | The name of the route to map. 24 | The route template for the route. 25 | 26 | 27 | Maps the specified route template and sets default route. 28 | A reference to the mapped route. 29 | A collection of routes for the application. 30 | The name of the route to map. 31 | The route template for the route. 32 | An object that contains default route values. 33 | 34 | 35 | Maps the specified route template and sets default route values and constraints. 36 | A reference to the mapped route. 37 | A collection of routes for the application. 38 | The name of the route to map. 39 | The route template for the route. 40 | An object that contains default route values. 41 | A set of expressions that specify values for routeTemplate. 42 | 43 | 44 | Maps the specified route template and sets default route values, constraints, and end-point message handler. 45 | A reference to the mapped route. 46 | A collection of routes for the application. 47 | The name of the route to map. 48 | The route template for the route. 49 | An object that contains default route values. 50 | A set of expressions that specify values for routeTemplate. 51 | The handler to which the request will be dispatched. 52 | 53 | 54 | A that passes ASP.NET requests into the pipeline and write the result back. 55 | 56 | 57 | Initializes a new instance of the class. 58 | The route data. 59 | 60 | 61 | Initializes a new instance of the class. 62 | The route data. 63 | The message handler to dispatch requests to. 64 | 65 | 66 | Provides code that handles an asynchronous task 67 | The asynchronous task. 68 | The HTTP context. 69 | 70 | 71 | A that returns instances of that can pass requests to a given instance. 72 | 73 | 74 | Initializes a new instance of the class. 75 | 76 | 77 | Provides the object that processes the request. 78 | An object that processes the request. 79 | An object that encapsulates information about the request. 80 | 81 | 82 | Gets the singleton instance. 83 | 84 | 85 | Provides the object that processes the request. 86 | An object that processes the request. 87 | An object that encapsulates information about the request. 88 | 89 | 90 | Provides a registration point for the simple membership pre-application start code. 91 | 92 | 93 | Registers the simple membership pre-application start code. 94 | 95 | 96 | Represents the web host buffer policy selector. 97 | 98 | 99 | Initializes a new instance of the class. 100 | 101 | 102 | Gets a value that indicates whether the host should buffer the entity body of the HTTP request. 103 | true if buffering should be used; otherwise a streamed request should be used. 104 | The host context. 105 | 106 | 107 | Uses a buffered output stream for the web host. 108 | A buffered output stream. 109 | The response. 110 | 111 | 112 | Provides the catch blocks used within this assembly. 113 | 114 | 115 | Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteBufferedResponseContentAsync. 116 | The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteBufferedResponseContentAsync. 117 | 118 | 119 | Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteErrorResponseContentAsync. 120 | The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteErrorResponseContentAsync. 121 | 122 | 123 | Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.ComputeContentLength. 124 | The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.ComputeContentLength. 125 | 126 | 127 | Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteStreamedResponseContentAsync. 128 | The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteStreamedResponseContentAsync. 129 | 130 | 131 | Gets the label for the catch block in System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpWebRoute.GetRouteData. 132 | The catch block in System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpWebRoute.GetRouteData. 133 | 134 | 135 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/bin/System.Web.Http.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter/bin/System.Web.Http.dll -------------------------------------------------------------------------------- /WebAPICustomActionFilter/bin/WebAPICustomActionFilter.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter/bin/WebAPICustomActionFilter.dll -------------------------------------------------------------------------------- /WebAPICustomActionFilter/bin/WebAPICustomActionFilter.dll.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/bin/WebAPICustomActionFilter.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter/bin/WebAPICustomActionFilter.pdb -------------------------------------------------------------------------------- /WebAPICustomActionFilter/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /WebAPICustomActionFilter/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /WebAPICustomActionFilter/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /WebAPICustomActionFilter/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /WebAPICustomActionFilter/obj/Debug/WebAPICustomActionFilter.csproj.CopyComplete: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter/obj/Debug/WebAPICustomActionFilter.csproj.CopyComplete -------------------------------------------------------------------------------- /WebAPICustomActionFilter/obj/Debug/WebAPICustomActionFilter.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 727abc9f70e152bd305cd68d3e83cce736438e80 2 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/obj/Debug/WebAPICustomActionFilter.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | F:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\WebAPICustomActionFilter.dll.config 2 | F:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\WebAPICustomActionFilter.dll 3 | F:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\WebAPICustomActionFilter.pdb 4 | F:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\Newtonsoft.Json.dll 5 | F:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\System.Net.Http.Formatting.dll 6 | F:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\System.Web.Http.dll 7 | F:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\System.Web.Http.WebHost.dll 8 | F:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\Newtonsoft.Json.xml 9 | F:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\System.Net.Http.Formatting.xml 10 | F:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\System.Web.Http.xml 11 | F:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\System.Web.Http.WebHost.xml 12 | F:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\obj\Debug\WebAPICustomActionFilter.csprojResolveAssemblyReference.cache 13 | F:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\obj\Debug\WebAPICustomActionFilter.dll 14 | F:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\obj\Debug\WebAPICustomActionFilter.pdb 15 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\WebAPICustomActionFilter.dll.config 16 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\WebAPICustomActionFilter.dll 17 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\WebAPICustomActionFilter.pdb 18 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\Newtonsoft.Json.dll 19 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\System.Net.Http.Formatting.dll 20 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\System.Web.Http.dll 21 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\System.Web.Http.WebHost.dll 22 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\Newtonsoft.Json.xml 23 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\System.Net.Http.Formatting.xml 24 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\System.Web.Http.xml 25 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\bin\System.Web.Http.WebHost.xml 26 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\obj\Debug\WebAPICustomActionFilter.csprojResolveAssemblyReference.cache 27 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\obj\Debug\WebAPICustomActionFilter.csproj.CoreCompileInputs.cache 28 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\obj\Debug\WebAPICustomActionFilter.dll 29 | D:\AKKI_DEV\RND\WebAPICustomActionFilter\WebAPICustomActionFilter\obj\Debug\WebAPICustomActionFilter.pdb 30 | -------------------------------------------------------------------------------- /WebAPICustomActionFilter/obj/Debug/WebAPICustomActionFilter.csprojResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter/obj/Debug/WebAPICustomActionFilter.csprojResolveAssemblyReference.cache -------------------------------------------------------------------------------- /WebAPICustomActionFilter/obj/Debug/WebAPICustomActionFilter.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter/obj/Debug/WebAPICustomActionFilter.dll -------------------------------------------------------------------------------- /WebAPICustomActionFilter/obj/Debug/WebAPICustomActionFilter.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/WebAPICustomActionFilter/obj/Debug/WebAPICustomActionFilter.pdb -------------------------------------------------------------------------------- /WebAPICustomActionFilter/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.5.2.2/Microsoft.AspNet.WebApi.5.2.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Microsoft.AspNet.WebApi.5.2.2/Microsoft.AspNet.WebApi.5.2.2.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.Client.5.2.2/Microsoft.AspNet.WebApi.Client.5.2.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Microsoft.AspNet.WebApi.Client.5.2.2/Microsoft.AspNet.WebApi.Client.5.2.2.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.Client.5.2.2/lib/net45/System.Net.Http.Formatting.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Microsoft.AspNet.WebApi.Client.5.2.2/lib/net45/System.Net.Http.Formatting.dll -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.Client.5.2.2/lib/portable-wp8%2Bnetcore45%2Bnet45%2Bwp81%2Bwpa81/System.Net.Http.Formatting.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Microsoft.AspNet.WebApi.Client.5.2.2/lib/portable-wp8%2Bnetcore45%2Bnet45%2Bwp81%2Bwpa81/System.Net.Http.Formatting.dll -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.Core.5.2.2/Content/web.config.transform: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.Core.5.2.2/Microsoft.AspNet.WebApi.Core.5.2.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Microsoft.AspNet.WebApi.Core.5.2.2/Microsoft.AspNet.WebApi.Core.5.2.2.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.Core.5.2.2/lib/net45/System.Web.Http.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Microsoft.AspNet.WebApi.Core.5.2.2/lib/net45/System.Web.Http.dll -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.WebHost.5.2.2/Microsoft.AspNet.WebApi.WebHost.5.2.2.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Microsoft.AspNet.WebApi.WebHost.5.2.2/Microsoft.AspNet.WebApi.WebHost.5.2.2.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.WebHost.5.2.2/lib/net45/System.Web.Http.WebHost.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Microsoft.AspNet.WebApi.WebHost.5.2.2/lib/net45/System.Web.Http.WebHost.dll -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebApi.WebHost.5.2.2/lib/net45/System.Web.Http.WebHost.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | System.Web.Http.WebHost 5 | 6 | 7 | 8 | Provides a global for ASP.NET applications. 9 | 10 | 11 | 12 | 13 | 14 | Gets the global . 15 | 16 | 17 | Extension methods for 18 | 19 | 20 | Maps the specified route template. 21 | A reference to the mapped route. 22 | A collection of routes for the application. 23 | The name of the route to map. 24 | The route template for the route. 25 | 26 | 27 | Maps the specified route template and sets default route. 28 | A reference to the mapped route. 29 | A collection of routes for the application. 30 | The name of the route to map. 31 | The route template for the route. 32 | An object that contains default route values. 33 | 34 | 35 | Maps the specified route template and sets default route values and constraints. 36 | A reference to the mapped route. 37 | A collection of routes for the application. 38 | The name of the route to map. 39 | The route template for the route. 40 | An object that contains default route values. 41 | A set of expressions that specify values for routeTemplate. 42 | 43 | 44 | Maps the specified route template and sets default route values, constraints, and end-point message handler. 45 | A reference to the mapped route. 46 | A collection of routes for the application. 47 | The name of the route to map. 48 | The route template for the route. 49 | An object that contains default route values. 50 | A set of expressions that specify values for routeTemplate. 51 | The handler to which the request will be dispatched. 52 | 53 | 54 | A that passes ASP.NET requests into the pipeline and write the result back. 55 | 56 | 57 | Initializes a new instance of the class. 58 | The route data. 59 | 60 | 61 | Initializes a new instance of the class. 62 | The route data. 63 | The message handler to dispatch requests to. 64 | 65 | 66 | Provides code that handles an asynchronous task 67 | The asynchronous task. 68 | The HTTP context. 69 | 70 | 71 | A that returns instances of that can pass requests to a given instance. 72 | 73 | 74 | Initializes a new instance of the class. 75 | 76 | 77 | Provides the object that processes the request. 78 | An object that processes the request. 79 | An object that encapsulates information about the request. 80 | 81 | 82 | Gets the singleton instance. 83 | 84 | 85 | Provides the object that processes the request. 86 | An object that processes the request. 87 | An object that encapsulates information about the request. 88 | 89 | 90 | Provides a registration point for the simple membership pre-application start code. 91 | 92 | 93 | Registers the simple membership pre-application start code. 94 | 95 | 96 | Represents the web host buffer policy selector. 97 | 98 | 99 | Initializes a new instance of the class. 100 | 101 | 102 | Gets a value that indicates whether the host should buffer the entity body of the HTTP request. 103 | true if buffering should be used; otherwise a streamed request should be used. 104 | The host context. 105 | 106 | 107 | Uses a buffered output stream for the web host. 108 | A buffered output stream. 109 | The response. 110 | 111 | 112 | Provides the catch blocks used within this assembly. 113 | 114 | 115 | Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteBufferedResponseContentAsync. 116 | The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteBufferedResponseContentAsync. 117 | 118 | 119 | Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteErrorResponseContentAsync. 120 | The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteErrorResponseContentAsync. 121 | 122 | 123 | Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.ComputeContentLength. 124 | The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.ComputeContentLength. 125 | 126 | 127 | Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteStreamedResponseContentAsync. 128 | The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteStreamedResponseContentAsync. 129 | 130 | 131 | Gets the label for the catch block in System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpWebRoute.GetRouteData. 132 | The catch block in System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpWebRoute.GetRouteData. 133 | 134 | 135 | -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.6.0.4/Newtonsoft.Json.6.0.4.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Newtonsoft.Json.6.0.4/Newtonsoft.Json.6.0.4.nupkg -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.6.0.4/lib/net20/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Newtonsoft.Json.6.0.4/lib/net20/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.6.0.4/lib/net35/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Newtonsoft.Json.6.0.4/lib/net35/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.6.0.4/lib/net40/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Newtonsoft.Json.6.0.4/lib/net40/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.6.0.4/lib/net45/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Newtonsoft.Json.6.0.4/lib/net45/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.6.0.4/lib/netcore45/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Newtonsoft.Json.6.0.4/lib/netcore45/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.6.0.4/lib/portable-net40%2Bsl5%2Bwp80%2Bwin8%2Bwpa81/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Newtonsoft.Json.6.0.4/lib/portable-net40%2Bsl5%2Bwp80%2Bwin8%2Bwpa81/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.6.0.4/lib/portable-net45%2Bwp80%2Bwin8%2Bwpa81/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshayblevel/WebAPI-CustomActionFilter/3f8ae74fd3c6b6f2403c10134e8ff33c35c12295/packages/Newtonsoft.Json.6.0.4/lib/portable-net45%2Bwp80%2Bwin8%2Bwpa81/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /packages/Newtonsoft.Json.6.0.4/tools/install.ps1: -------------------------------------------------------------------------------- 1 | param($installPath, $toolsPath, $package, $project) 2 | 3 | # open json.net splash page on package install 4 | # don't open if json.net is installed as a dependency 5 | 6 | try 7 | { 8 | $url = "http://james.newtonking.com/json" 9 | $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) 10 | 11 | if ($dte2.ActiveWindow.Caption -eq "Package Manager Console") 12 | { 13 | # user is installing from VS NuGet console 14 | # get reference to the window, the console host and the input history 15 | # show webpage if "install-package newtonsoft.json" was last input 16 | 17 | $consoleWindow = $(Get-VSComponentModel).GetService([NuGetConsole.IPowerConsoleWindow]) 18 | 19 | $props = $consoleWindow.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor ` 20 | [System.Reflection.BindingFlags]::NonPublic) 21 | 22 | $prop = $props | ? { $_.Name -eq "ActiveHostInfo" } | select -first 1 23 | if ($prop -eq $null) { return } 24 | 25 | $hostInfo = $prop.GetValue($consoleWindow) 26 | if ($hostInfo -eq $null) { return } 27 | 28 | $history = $hostInfo.WpfConsole.InputHistory.History 29 | 30 | $lastCommand = $history | select -last 1 31 | 32 | if ($lastCommand) 33 | { 34 | $lastCommand = $lastCommand.Trim().ToLower() 35 | if ($lastCommand.StartsWith("install-package") -and $lastCommand.Contains("newtonsoft.json")) 36 | { 37 | $dte2.ItemOperations.Navigate($url) | Out-Null 38 | } 39 | } 40 | } 41 | else 42 | { 43 | # user is installing from VS NuGet dialog 44 | # get reference to the window, then smart output console provider 45 | # show webpage if messages in buffered console contains "installing...newtonsoft.json" in last operation 46 | 47 | $instanceField = [NuGet.Dialog.PackageManagerWindow].GetField("CurrentInstance", [System.Reflection.BindingFlags]::Static -bor ` 48 | [System.Reflection.BindingFlags]::NonPublic) 49 | $consoleField = [NuGet.Dialog.PackageManagerWindow].GetField("_smartOutputConsoleProvider", [System.Reflection.BindingFlags]::Instance -bor ` 50 | [System.Reflection.BindingFlags]::NonPublic) 51 | if ($instanceField -eq $null -or $consoleField -eq $null) { return } 52 | 53 | $instance = $instanceField.GetValue($null) 54 | if ($instance -eq $null) { return } 55 | 56 | $consoleProvider = $consoleField.GetValue($instance) 57 | if ($consoleProvider -eq $null) { return } 58 | 59 | $console = $consoleProvider.CreateOutputConsole($false) 60 | 61 | $messagesField = $console.GetType().GetField("_messages", [System.Reflection.BindingFlags]::Instance -bor ` 62 | [System.Reflection.BindingFlags]::NonPublic) 63 | if ($messagesField -eq $null) { return } 64 | 65 | $messages = $messagesField.GetValue($console) 66 | if ($messages -eq $null) { return } 67 | 68 | $operations = $messages -split "==============================" 69 | 70 | $lastOperation = $operations | select -last 1 71 | 72 | if ($lastOperation) 73 | { 74 | $lastOperation = $lastOperation.ToLower() 75 | 76 | $lines = $lastOperation -split "`r`n" 77 | 78 | $installMatch = $lines | ? { $_.StartsWith("------- installing...newtonsoft.json ") } | select -first 1 79 | 80 | if ($installMatch) 81 | { 82 | $dte2.ItemOperations.Navigate($url) | Out-Null 83 | } 84 | } 85 | } 86 | } 87 | catch 88 | { 89 | # stop potential errors from bubbling up 90 | # worst case the splash page won't open 91 | } 92 | 93 | # yolo -------------------------------------------------------------------------------- /packages/repositories.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --------------------------------------------------------------------------------