DiscordMediaLoader/Discord Media Loader.Application/Classes/Job.cs
Serraniel 53f49b20c5 Did some of the MainForm stuff
Referenced SweetLib directly (temporary) instead vie Nuget for now.
2017-04-17 14:39:29 +02:00

37 lines
966 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static SweetLib.Utils.Logger.Logger;
namespace DML.Application.Classes
{
public class Job
{
public int Id { get; set; }
public ulong GuildId { get; set; }
public ulong ChannelId { get; set; }
internal void Store()
{
Debug("Storing job to database...");
Trace("Getting jobs collection...");
var jobDb = Core.Database.GetCollection<Job>("jobs");
Trace("Adding new value...");
jobDb.Insert(this);
}
internal static IEnumerable<Job> RestoreJobs()
{
Debug("Restoring jobs...");
Trace("Getting jobs collection...");
var jobDb = Core.Database.GetCollection<Job>("jobs");
Trace("Creating new empty job list");
return jobDb.FindAll();
}
}
}