Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Williams authored Jun 18, 2016
1 parent 3b1c1d8 commit 6f226da
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,51 @@ namespace Blitline.Net.Test
}
```

Custom Functions
------------
If a function that you require isn't available, you can now add your own and use the AddFunction<TBuilder,TFunction> method

```
public class MyFunction : BlitlineFunction
{
public int Age { get; private set; }
public override string Name { get { return "My Function"; }
public override dynamic Params
{
get
{
return new {
age = Age
};
}
}
}
public class MyFunctionBuilder : FunctionBuilder<MyFunction>
{
public MyFunctionBuilder WithAge(int age)
{
BuildImp.Age = age;
return this;
}
}
public class BlitlineTest
{
public static void Main (string [] args)
{
var request = BuildA.Request (r => r
.WithApplicationId ("appId")
.WithSourceImageUri (new Uri ("imageUrl"))
.AddFunction<MyFunctionBuilder, MyFunction> (x => x.WithAge (123)
.SaveAs (s => s.WithImageIdentifier (imageIdentifier)
.ToS3 (s3 => s3.ToBucket (bucketName)
.WithKey ("annotate-default.png")))));
var response = request.Send();
Console.Read();
}
}
```

Released under the Simple Public License (SimPL 2.0): http://opensource.org/licenses/SimPL-2.0

0 comments on commit 6f226da

Please sign in to comment.