private static void UpdateBlob(DSModel db, KeyBinder key, FileBlobModel model) { FileBlob poco = db.FileBlobs.Where(b => b.BlobID == model.BlobID).FirstOrDefault(); if (poco == null) throw new ArgumentException("File does not exist!", "BlobID"); model.Map(poco); }
private static void InsertBlob(DSModel db, KeyBinder key, FileBlobModel model) { key.AddRollback(model.BlobID, model, model.GetName(p => p.BlobID)); FileBlob poco = new FileBlob(); model.Map(poco); db.Add(poco); key.AddKey(poco, model, model.GetName(p => p.BlobID)); }