public LiteDbOdbBackendStream(LiteDbBackend backend, ObjectType objectType, long length)
     : base(backend)
 {
     _objectType = objectType;
     _length     = length;
     _stream     = new MemoryStream();
 }
예제 #2
0
        public void LiteDbBackend(Signature signature, string message)
        {
            var path = GetTempPath();

            Repository.Init(path, true);
            using (var repository = new Repository(path))
            {
                using (var sut = new LiteDbBackend(Path.Combine(path, "lite.db")))
                {
                    repository.ObjectDatabase.AddBackend(sut, priority: 5);

                    var definition = !repository.Info.IsHeadUnborn ? TreeDefinition.From(repository.Head.Tip.Tree) : new TreeDefinition();
                    definition.Add("somefile.txt", repository.CreateBlob("foo"), Mode.NonExecutableFile);
                    repository.Commit(
                        definition,
                        message,
                        signature, signature);
                }
            }
        }
 public LiteDbOdbBackendStream(LiteDbBackend backend, Stream stream)
     : base(backend)
 {
     _stream = stream;
 }