A simple ActionResult class that serializes an object to binary JSON format, with the help the Json.NET library.

    public class BsonResult : ActionResult
        private object _data;

        public BsonResult(object data)
            this._data = data;

        public override void ExecuteResult(ControllerContext context)
            HttpContextBase httpContextBase = context.HttpContext;
            httpContextBase.Response.Buffer = true;

            httpContextBase.Response.ContentType = "application/bson";
            JsonSerializer serializer = new JsonSerializer();
            // serialize to BSON
            BsonWriter writer = new BsonWriter(httpContextBase.Response.OutputStream);
            serializer.Serialize(writer, _data);