示例#1
0
        private BinaryDataValue CreateBinaryDataValue(InMemoryDataBase db, BinaryPropertyDoc binaryDoc, FileDoc fileDoc = null)
        {
            if (fileDoc == null)
            {
                fileDoc = db.Files.FirstOrDefault(x => x.FileId == binaryDoc.FileId);
            }

            return(new BinaryDataValue
            {
                Id = binaryDoc.BinaryPropertyId,
                FileId = binaryDoc.FileId,
                Checksum = null,
                FileName = fileDoc == null ? null : new BinaryFileName(fileDoc.FileNameWithoutExtension, fileDoc.Extension),
                ContentType = fileDoc?.ContentType,
                Size = fileDoc?.Size ?? 0L,
                BlobProviderName = fileDoc?.BlobProvider,
                BlobProviderData = fileDoc?.BlobProviderData,
                Timestamp = fileDoc?.Timestamp ?? 0L
            });
        }
 public InMemoryTransaction(InMemoryDataBase db)
 {
     _db = db;
     Monitor.Enter(_db, ref _lockWasTaken);
 }
示例#3
0
 public DataCollection(InMemoryDataBase db, int lastId = 0)
 {
     _db     = db;
     _lastId = lastId;
 }