コード例 #1
0
 public Question(BsonValue bsonValue)
 {
     this.Id             = bsonValue.TryGetString("_id", String.Empty);
     this.UserIdAsked    = bsonValue.TryGetInt32("UserIdAsked", 0);
     this.UserIdAnswered = bsonValue.TryGetInt32("UserIdAnswered", 0);
     this.AskedByName    = bsonValue.TryGetString("AskedByName", String.Empty);
     this.AskedByEmail   = bsonValue.TryGetString("AskedByEmail", String.Empty);
     this.AskedByPhone   = bsonValue.TryGetString("AskedByPhone", String.Empty);
     this.DateTime       = bsonValue.TryGetNullableDateTime("DateTime", new Nullable <DateTime>());
     this.Text           = bsonValue.TryGetString("Text", String.Empty);
     this.Area           = bsonValue.TryGetString("Area", String.Empty);
     this.Views          = bsonValue.TryGetInt32("Views", 0);
     this.Approved       = bsonValue.TryGetBoolean("Approved", false);
     this.Archived       = bsonValue.TryGetBoolean("Archived", false);
     this.Removed        = bsonValue.TryGetBoolean("Removed", false);
     this.Replied        = bsonValue.TryGetBoolean("Replied", false);
 }
コード例 #2
0
ファイル: QuestionAnswer.cs プロジェクト: jdheywood/4um
 public QuestionAnswer(BsonValue bsonValue)
 {
     this.Id                = bsonValue.TryGetString("_id", String.Empty);
     this.UserId            = bsonValue.TryGetInt32("UserId", 0);
     this.DateTime          = bsonValue.TryGetString("DateTime", String.Empty);
     this.DateTimeForMoment = bsonValue.TryGetString("DateTimeForMoment", String.Empty);
     this.Text              = bsonValue.TryGetString("Text", String.Empty);
     this.CleanText         = StringHelper.StripHTML(bsonValue.TryGetString("Text", String.Empty));
     this.Tags              = bsonValue.TryGetString("Tags", String.Empty);
     this.Public            = bsonValue.TryGetBoolean("Public", false);
     this.Removed           = bsonValue.TryGetBoolean("Removed", false);
 }