SessionData.cs
Home
/
Application /
SessionData.cs
namespace CodeEditorApi
{
public class SessionData
{
public DateTime Timestamp { get; set; }
public Guid SessionId { get; set; }
public object Data { get; set; } = default!;
public DataType Type { get; set; }
public string FileName
{
get
{
return SessionId.ToString() + "/" + Helpers.SessionFiles.GetFormattedDate(Timestamp) + FileExtension;
}
}
public string FileExtension {
get
{
if (Type == DataType.Javascript)
{
return ".js";
}
else if (Type == DataType.CSS)
{
return ".css";
}
else if (Type == DataType.HTML)
{
return ".html";
}
return ".txt";
}
}
}
public enum DataType
{
Javascript,
HTML,
CSS,
Text
}
}