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(); }
/// <summary> /// Create a new BlobEvent object. /// </summary> /// <param name="blobEventId">Initial value of the BlobEventId property.</param> /// <param name="eventType">Initial value of the EventType property.</param> /// <param name="eventDateTime">Initial value of the EventDateTime property.</param> public static BlobEvent CreateBlobEvent(global::System.Guid blobEventId, global::System.Int32 eventType, global::System.DateTime eventDateTime) { BlobEvent blobEvent = new BlobEvent(); blobEvent.BlobEventId = blobEventId; blobEvent.EventType = eventType; blobEvent.EventDateTime = eventDateTime; return blobEvent; }
private static void CompleteBlobEvent(BlobEvent @event, RequestData request) { if (request != null) { @event.Url = request.Url; @event.UserAgent = request.UserAgent; @event.RemoteMachine = request.RemoteMachine; @event.SessionId = request.SessionId; } }
/// <summary> /// Deprecated Method for adding a new object to the BlobEvents EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToBlobEvents(BlobEvent blobEvent) { base.AddObject("BlobEvents", blobEvent); }