public void CreateEventUserDownloadBlob(User user, Blob blob, RequestData request) { BlobEvent @event = new BlobEvent() { BlobEventId = Guid.NewGuid(), EventDateTime = DateTime.UtcNow, EventType = (int)EventType.Download, User = user, Blob = blob }; CompleteBlobEvent(@event, request); this.context.BlobEvents.AddObject(@event); this.context.SaveChanges(); }
public Permission GrantPermissionToUserBlob(Privilege privilege, User user, Blob blob, DateTime expiration) { var permission = new Permission() { PermissionId = Guid.NewGuid(), Privilege = (int)privilege, Blob = this.context.Blobs.Single(br => br.BlobId == blob.BlobId), CreationDateTime = DateTime.UtcNow, ExpirationDateTime = expiration }; permission.Users.Add(this.context.Users.Single(u => u.UserId == user.UserId)); this.context.Permissions.AddObject(permission); this.context.SaveChanges(); return permission; }
public Permission GrantPermissionToRoleBlob(Privilege privilege, Role role, Blob blob, DateTime expiration) { var permission = new Permission() { PermissionId = Guid.NewGuid(), Privilege = (int)privilege, Blob = blob, CreationDateTime = DateTime.UtcNow, ExpirationDateTime = expiration }; permission.Roles.Add(this.context.Roles.Single(r => r.RoleId == role.RoleId)); this.context.Permissions.AddObject(permission); this.context.SaveChanges(); return permission; }
public void CreateEventUserDownloadBlob(string nameIdentifier, string identityProvider, Blob blob, RequestData request) { User user = this.userService.RetrieveUserByNameIdentifier(nameIdentifier, identityProvider); this.CreateEventUserDownloadBlob(user, blob, request); }
public void CreateEventUserDownloadBlob(string nameIdentifier, string identityProvider, Blob blob) { this.CreateEventUserDownloadBlob(nameIdentifier, identityProvider, blob, this.GetRequestData()); }
public void CreateEventUserDownloadBlob(User user, Blob blob) { this.CreateEventUserDownloadBlob(user, blob, this.GetRequestData()); }
public Guid UploadBlob(Blob blob, System.IO.Stream stream) { throw new NotImplementedException(); }
public Guid UploadBlob(Blob blob, string filePath) { throw new NotImplementedException(); }
public string GetBlobName(Blob blob) { throw new NotImplementedException(); }
public string GetContentType(Blob blob) { throw new NotImplementedException(); }
public CloudBlob GetBlob(Blob blob) { return new CloudBlob("http://localhost:10002/blob.jgp"); }
public Guid CreateBlob(Blob blob) { throw new NotImplementedException(); }
private Blob GetTestBlob(BlobShareDataStoreEntities context) { Blob blob = new Blob() { BlobId = Guid.NewGuid(), Name = "Test Blob Resource", OriginalFileName = "originalfile.txt", UploadDateTime = DateTime.UtcNow }; context.Blobs.AddObject(blob); return blob; }
/// <summary> /// Create a new Blob object. /// </summary> /// <param name="blobId">Initial value of the BlobId property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="originalFileName">Initial value of the OriginalFileName property.</param> /// <param name="uploadDateTime">Initial value of the UploadDateTime property.</param> public static Blob CreateBlob(global::System.Guid blobId, global::System.String name, global::System.String originalFileName, global::System.DateTime uploadDateTime) { Blob blob = new Blob(); blob.BlobId = blobId; blob.Name = name; blob.OriginalFileName = originalFileName; blob.UploadDateTime = uploadDateTime; return blob; }
/// <summary> /// Deprecated Method for adding a new object to the Blobs EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToBlobs(Blob blob) { base.AddObject("Blobs", blob); }