├── ApirLib
├── swaGUI.js
├── NuGet
│ ├── lib
│ │ └── ApirLib.dll
│ ├── ApirIO.nuspec
│ └── content
│ │ └── App_Start
│ │ ├── ApirAssemblyResolver.cs.pp
│ │ └── ApirConfig.cs.pp
├── Credentials.cs
├── IProvidePrincipal.cs
├── AppConfig.cs
├── NullFilter.cs
├── SqlProcBuilder.cs
├── NLogExceptionLogger.cs
├── DbExtensions.cs
├── Properties
│ └── AssemblyInfo.cs
├── ApirModel.cd
├── ProcWatcher.cs
├── App.config
├── ApirBuilder.cs
├── ApiKeyAuthHandler.cs
├── DataTableExtensions.cs
├── UserValidator.cs
├── BasicAuthMessageHandler.cs
├── Models.cs
├── CorsHandler.cs
├── TypeMapper.cs
├── SwaPrincipalProvider.cs
├── ApirSettings.cs
├── DllBuilder.cs
├── packages.config
├── BasicAuthModule.cs
├── IonicGenerator.cs
├── ApirLib.csproj
├── App_Start
│ └── SwaggerConfig.cs
├── ModelBuilder.cs
└── CodeBuilder.cs
├── ApirIO.sln
├── .gitignore
├── README.md
└── LICENSE
/ApirLib/swaGUI.js:
--------------------------------------------------------------------------------
1 | Alert('Hello');
2 |
3 |
--------------------------------------------------------------------------------
/ApirLib/NuGet/lib/ApirLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oeoren/ApirIO/HEAD/ApirLib/NuGet/lib/ApirLib.dll
--------------------------------------------------------------------------------
/ApirLib/Credentials.cs:
--------------------------------------------------------------------------------
1 | namespace Apir
2 | {
3 | public class Credentials
4 | {
5 | public string Username { get; set; }
6 | public string Password { get; set; }
7 | }
8 | }
--------------------------------------------------------------------------------
/ApirLib/IProvidePrincipal.cs:
--------------------------------------------------------------------------------
1 | using System.Security.Principal;
2 |
3 | namespace Apir
4 | {
5 | public interface IProvidePrincipal
6 | {
7 | IPrincipal CreatePrincipal(string username, string password);
8 | }
9 | }
--------------------------------------------------------------------------------
/ApirLib/AppConfig.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace ApirLib
8 | {
9 | class AppConfig
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/ApirLib/NullFilter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Net;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Web.Http;
8 | using System.Web.Http.Filters;
9 |
10 | namespace ApirLib
11 | {
12 | public class NullFilter : ActionFilterAttribute
13 | {
14 | public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
15 | {
16 | var response = actionExecutedContext.Response;
17 |
18 | //object responseValue;
19 | //bool hasContent = response.TryGetContentValue(out responseValue);
20 |
21 | //if (!hasContent)
22 | // throw new HttpResponseException(HttpStatusCode.NotFound);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/ApirLib/NuGet/ApirIO.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ApirIO
5 | 2.2.4
6 | Ole Oren
7 | Ole Oren
8 | http://apir.io
9 | http://apir.azurewebsites.net/favicon.ico
10 | false
11 | Create WebApi from SQL Server Stored Procedures
12 | Documentation.
13 | Copyright 2018
14 | SQL REST WebApi AspNet AspNetWebApi SelfHost Apir
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ApirLib/SqlProcBuilder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data.SqlClient;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ApirLib
9 | {
10 | public class SqlProcBuilder
11 | {
12 | static public void Exec(string conString, string src)
13 | {
14 | var con = new SqlConnection(conString);
15 | SqlCommand cmd = new SqlCommand(src, con);
16 | try
17 | {
18 | con.Open();
19 | cmd.ExecuteNonQuery();
20 | }
21 | catch (Exception ex)
22 | {
23 | throw ex;
24 | }
25 | finally
26 | {
27 | cmd.Dispose();
28 | cmd = null;
29 | con.Close();
30 | }
31 |
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/ApirIO.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApirLib", "ApirLib\ApirLib.csproj", "{0D91302B-D4DD-4708-A426-504AF1820D59}"
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 | {0D91302B-D4DD-4708-A426-504AF1820D59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {0D91302B-D4DD-4708-A426-504AF1820D59}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {0D91302B-D4DD-4708-A426-504AF1820D59}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {0D91302B-D4DD-4708-A426-504AF1820D59}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/ApirLib/NLogExceptionLogger.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Net.Http;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Web.Http.ExceptionHandling;
9 |
10 | namespace ApirLib
11 | {
12 | public class NLogExceptionLogger : ExceptionLogger
13 | {
14 | private static readonly Logger logger = LogManager.GetCurrentClassLogger();
15 | public override void Log(ExceptionLoggerContext context)
16 | {
17 | logger.Error(RequestToString(context.Request) + " " + context.Exception.Message, context.Exception, new List