sledgemapper/Sledgemapper.Api/Notifications/BaseNotification.cs
Michele Scandura 0a4b8ebeb2 progress
2020-11-17 15:16:14 +00:00

34 lines
1 KiB
C#

using MediatR;
using Sledgemapper.Shared.Entities;
using System;
namespace Sledgemapper.Api.Handlers
{
public abstract class BaseNotification : INotification
{
public double Timestamp { get; private set; }
public string SessionName { get; private set; }
public int UserId { get; private set; }
public int SessionId { get; set; }
public Models.Session Session { get; set; }
public BaseNotification(string sessionName, int userId)
{
Timestamp = DateTimeOffset.Now.ToUnixTimeMilliseconds();
SessionName = sessionName;
UserId = userId;
}
public BaseNotification(Models.Session session, int userId)
{
Timestamp = DateTimeOffset.Now.ToUnixTimeMilliseconds();
Session = session;;
UserId = userId;
}
public BaseNotification(int sessionId, string sessionName, int userId) : this(sessionName, userId)
{
SessionId = sessionId;
}
}
}