From 6307ab92f06b9c0e08efdae3d8d85dc91522c76e Mon Sep 17 00:00:00 2001 From: bchavez Date: Tue, 3 Nov 2015 07:16:21 -0800 Subject: [PATCH] Port Profile.java/.cs. Fixes #8 --- Source/RethinkDb.Driver/Model/Profile.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/RethinkDb.Driver/Model/Profile.cs b/Source/RethinkDb.Driver/Model/Profile.cs index 416160e..311913f 100644 --- a/Source/RethinkDb.Driver/Model/Profile.cs +++ b/Source/RethinkDb.Driver/Model/Profile.cs @@ -5,13 +5,20 @@ namespace RethinkDb.Driver.Model { public class Profile { + public Profile(JArray profileObj) + { + this.ProfileObj = profileObj; + } + + public JArray ProfileObj { get; } + public static Profile FromJsonArray(JArray profileObj) { - if( profileObj == null ) + if( profileObj == null && profileObj.Count == 0 ) { return null; } - throw new Exception("fromJSONArray not implemented"); + return new Profile(profileObj); } } } \ No newline at end of file