This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using Autofac; | |
using Autofac.Core; | |
using NLog; | |
using log4net; | |
using LogManager = NLog.LogManager; | |
namespace AutofacIdea | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void ConfigureForTesting(this ApiController controller, HttpRequestMessage request, string routeName = null, HttpRoute route = null) | |
{ | |
var config = new HttpConfiguration(); | |
controller.Configuration = config; | |
if (routeName != null && route !=null) | |
config.Routes.Add(routeName, route); | |
else | |
route = config.Routes.MapHttpRoute("DefaultApi", "{controller}/{id}", new { id = RouteParameter.Optional }); | |
var controllerTypeName = controller.GetType().Name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Data.Common; | |
using System.Runtime.CompilerServices; | |
using System.Text; | |
using Npgsql; | |
GetCatalogItemsSql(null, null, null, 10); | |
void GetCatalogItemsSql(int? catalogBrandId, int? before, int? after, int pageSize) | |
{ | |
// This looks like it would be susceptible to SQL injection, but it's not. |