예제 #1
0
        public void Test4([DataSources] string context)
        {
            var tableName = nameof(BlobClass) + TestUtils.GetNext().ToString();

            using (var db = GetDataContext(context))
                using (var table = db.CreateLocalTable <BlobClass>(tableName))
                {
                    db.InlineParameters = true;

                    var e = new BlobClass()
                    {
                        Id = 1, BlobValue = new byte[] { 1, 2, 3 }
                    };

                    db.Insert(e, tableName);

                    var v = table.First(_ => _.Id == 1);

                    AreEqual(new byte[] { 1, 2, 3 }, v.BlobValue);

                    e.BlobValue = new byte[] { 3, 2, 1 };

                    v = table.First(_ => _.Id == 1);

                    AreEqual(new byte[] { 3, 2, 1 }, v.BlobValue);
                }
        }
예제 #2
0
        public void Test4(string context)
        {
            using (var db = GetDataContext(context))
                using (db.CreateLocalTable <BlobClass>())
                {
                    db.InlineParameters = true;

                    var e = new BlobClass()
                    {
                        Id = 1, BlobValue = new byte[] { 1, 2, 3 }
                    };

                    db.Insert(e);

                    var v = db.GetTable <BlobClass>().First(_ => _.Id == 1);

                    AreEqual(new byte[] { 1, 2, 3 }, v.BlobValue);

                    e.BlobValue = new byte[] { 3, 2, 1 };

                    v = db.GetTable <BlobClass>().First(_ => _.Id == 1);

                    AreEqual(new byte[] { 3, 2, 1 }, v.BlobValue);
                }
        }
예제 #3
0
파일: Issue421.cs 프로젝트: zxsanny/linq2db
        public void Test3(string context)
        {
            using (var db = GetDataContext(context))
                using (new LocalTable <BlobClass>(db))
                {
                    var e = new BlobClass()
                    {
                        Id = 1, BlobValue = new byte[] { 1, 2, 3 }
                    };

                    db.Insert(e);

                    var v = db.GetTable <BlobClass>().First(_ => _.Id == 1);

                    AreEqual(new byte[] { 1, 2, 3 }, v.BlobValue);

                    e.BlobValue = new byte[] { 3, 2, 1 };

                    v = db.GetTable <BlobClass>().First(_ => _.Id == 1);

                    AreEqual(new byte[] { 3, 2, 1 }, v.BlobValue);
                }
        }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExtendedBlob"/> class.
 /// An adapter from a regular blob class.
 /// </summary>
 /// <param name="blob">The blob.</param>
 /// <param name="id">The id of the blob.Null indicates unknown id.</param>
 /// <param name="blobClass">To which classes a blob belongs to.</param>
 /// <param name="rectangle">The rectangle that surounds the blob.Can not be null.</param>
 /// <see cref="Blob"/>
 /// <exception cref="ArgumentNullException">Any of the arguments is null.</exception>
 public ExtendedBlob(Blob blob, String id, BlobClass blobClass, Rectangle rectangle)
     : base(1, rectangle, blob.Image)
 {
     initialize(id, blobClass, rectangle);
 }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExtendedBlob"/> class.
 /// </summary>
 /// <param name="image">The image.</param>
 /// <param name="location">The location.</param>
 /// <param name="owner">The owner.</param>
 /// <param name="id">The id of the blob.Null indicates unknown id.</param>
 /// <param name="blobClass">To which classes a blob belongs to.</param>
 /// <param name="rectangle">The rectangle that surounds the blob.Can not be null.</param>
 /// <see cref="Blob"/>
 /// <exception cref="ArgumentNullException">Any of the arguments is null.</exception>
 public ExtendedBlob(Bitmap image, Point location, Bitmap owner, string id, BlobClass blobClass, Rectangle rectangle)
     : base(1, rectangle, owner)
 {
     initialize(id, blobClass, rectangle);
 }
예제 #6
0
 private void initialize(String blobId, BlobClass bClass, Rectangle rectangle)
 {
     id            = blobId;
     blobClass     = bClass;
     blobRectangle = rectangle;
 }