コード例 #1
0
ファイル: EventService.cs プロジェクト: ShuHuiC/BlobShare
        private void CreateUserEvent(User user, UserEventType type, RequestData request)
        {
            UserEvent @event = new UserEvent()
            {
                UserEventId = Guid.NewGuid(),
                User = user,
                EventType = (int)type,
                EventDateTime = DateTime.UtcNow
            };

            CompleteUserEvent(@event, request);

            this.context.UserEvents.AddObject(@event);
            this.context.SaveChanges();
        }
コード例 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the UserEvents EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUserEvents(UserEvent userEvent)
 {
     base.AddObject("UserEvents", userEvent);
 }
コード例 #3
0
ファイル: EventService.cs プロジェクト: ShuHuiC/BlobShare
 private static void CompleteUserEvent(UserEvent @event, RequestData request)
 {
     if (request != null)
     {
         @event.Url = request.Url;
         @event.UserAgent = request.UserAgent;
         @event.RemoteMachine = request.RemoteMachine;
         @event.SessionId = request.SessionId;
     }
 }
コード例 #4
0
 /// <summary>
 /// Create a new UserEvent object.
 /// </summary>
 /// <param name="userEventId">Initial value of the UserEventId property.</param>
 /// <param name="eventType">Initial value of the EventType property.</param>
 /// <param name="eventDateTime">Initial value of the EventDateTime property.</param>
 public static UserEvent CreateUserEvent(global::System.Guid userEventId, global::System.Int32 eventType, global::System.DateTime eventDateTime)
 {
     UserEvent userEvent = new UserEvent();
     userEvent.UserEventId = userEventId;
     userEvent.EventType = eventType;
     userEvent.EventDateTime = eventDateTime;
     return userEvent;
 }