예제 #1
0
 public static InjectionOptions TerminateStatement(this InjectionOptions injector, CommentStyle commentStyle, int parenthesisNestingDepth = 0, bool useSemicolon = false)
 {
     injector.CommentStyle              = commentStyle;
     injector.ParenthesisNestingDepth   = parenthesisNestingDepth;
     injector.EndStatementBeforeComment = useSemicolon;
     return(injector);
 }
예제 #2
0
 public static InjectionOptions IntoQueryStringParameter(this InjectionOptions injector, string parameterName, int initialValue)
 {
     injector.ParameterName = parameterName;
     injector.Location      = InjectionLocation.QueryString;
     injector.InitialValue  = initialValue;
     injector.ParameterType = typeof(int);
     return(injector);
 }
예제 #3
0
 public static InjectionOptions IntoRouteParameter(this InjectionOptions injector, int initialValue, string parameterName = "sql")
 {
     injector.ParameterName = parameterName;
     injector.Location      = InjectionLocation.Route;
     injector.InitialValue  = initialValue;
     injector.ParameterType = typeof(int);
     return(injector);
 }
예제 #4
0
 public static InjectionOptions IntoForm(this InjectionOptions injector, string fieldName, int initialValue, Func <IEnumerable <KeyValuePair <string, string> > > formFields = null)
 {
     injector.ParameterName = fieldName;
     injector.Location      = InjectionLocation.Form;
     injector.FormFields    = formFields;
     injector.InitialValue  = initialValue;
     injector.ParameterType = typeof(int);
     return(injector);
 }
예제 #5
0
 public static InjectionOptions IntoQueryStringParameter(this InjectionOptions injector, string parameterName, string initialValue, QuoteStyle quoteStyle = QuoteStyle.SingleQuote)
 {
     injector.ParameterName = parameterName;
     injector.Location      = InjectionLocation.QueryString;
     injector.InitialValue  = initialValue;
     injector.ParameterType = typeof(string);
     injector.QuoteStyle    = quoteStyle;
     return(injector);
 }
예제 #6
0
 public static InjectionOptions IntoForm(this InjectionOptions injector, string fieldName, string initialValue, Func <IEnumerable <KeyValuePair <string, string> > > formFields = null, QuoteStyle quoteStyle = QuoteStyle.SingleQuote)
 {
     injector.ParameterName = fieldName;
     injector.Location      = InjectionLocation.Form;
     injector.FormFields    = formFields;
     injector.InitialValue  = initialValue;
     injector.ParameterType = typeof(string);
     injector.QuoteStyle    = quoteStyle;
     return(injector);
 }
예제 #7
0
 public static InjectionOptions IntoForm(this InjectionOptions injector, string fieldName)
 {
     injector.ParameterName = fieldName;
     injector.Location      = InjectionLocation.Form;
     return(injector);
 }
예제 #8
0
 public static InjectionOptions IntoQueryStringParameter(this InjectionOptions injector, string parameterName)
 {
     injector.ParameterName = parameterName;
     injector.Location      = InjectionLocation.QueryString;
     return(injector);
 }
예제 #9
0
 public static InjectionOptions IntoRouteParameter(this InjectionOptions injector, string parameterName = "sql")
 {
     injector.ParameterName = parameterName;
     injector.Location      = InjectionLocation.Route;
     return(injector);
 }
예제 #10
0
 public static InjectionOptions UsePost(this InjectionOptions injector, Func <HttpContent> contentFactory = null)
 {
     injector.Method         = HttpMethod.Post;
     injector.ContentFactory = contentFactory;
     return(injector);
 }
예제 #11
0
 public static InjectionOptions UseGet(this InjectionOptions injector) => injector.UseHttpMethod(HttpMethod.Get);
예제 #12
0
 public static InjectionOptions UseHttpMethod(this InjectionOptions injector, HttpMethod method)
 {
     injector.Method = method;
     return(injector);
 }
예제 #13
0
 public static InjectionOptions AsInteger(this InjectionOptions injector, int?initialValue = null)
 {
     injector.InitialValue = initialValue;
     return(injector);
 }
예제 #14
0
 public static InjectionOptions AsString(this InjectionOptions injector, string initialValue = null, QuoteStyle quoteStyle = QuoteStyle.SingleQuote)
 {
     injector.InitialValue = initialValue;
     injector.QuoteStyle   = quoteStyle;
     return(injector);
 }
예제 #15
0
 public Injector(InjectionOptions options, HttpClient http)
 {
     Options = options;
     Http    = http;
 }