Exemplo n.º 1
0
        public static BsonDocument AttachCreationMetaData(this BsonDocument doc, IMongoIdentity user)
        {
            doc["OwnerId"] = user.GetOwnerId();
            doc["CreatedOn"] = DateTime.Now;
            doc["LastModifiedOn"] = DateTime.Now;
            doc["LastUpdatedBy"] = user.GetOwnerId();
            doc["UTCOffset"] = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now).ToString();

            return doc;
        }
Exemplo n.º 2
0
 public static bool IsOwner(this BsonDocument doc, IMongoIdentity user)
 {
     return doc.Contains("OwnerId") && (doc["OwnerId"].AsInt64 == user.GetOwnerId());
 }