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)); }
public static CheckResult ValidateSave(DSModel db, FileBlobModel model) { CheckResult res = new CheckResult(model); if (string.IsNullOrWhiteSpace(model.BlobName)) res.AddError("File name cannot bet empty!", model.GetName(p => p.BlobName)); if (string.IsNullOrWhiteSpace(model.BlobExtension)) res.AddError("File extension cannot be empty!", model.GetName(p => p.BlobExtension)); if (model.BlobData == null || model.BlobData.Length == 0) res.AddError("File data cannot be empty!", model.GetName(p => p.BlobData)); return res; }