Adding CommandPermission Entity
This commit is contained in:
parent
ddce0a9504
commit
703e5ae411
53
ChaosBot/Database/Entity/CommandPermissions.cs
Normal file
53
ChaosBot/Database/Entity/CommandPermissions.cs
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
using System;
|
||||||
|
using System.Data;
|
||||||
|
using ChaosBot.Attribute;
|
||||||
|
|
||||||
|
namespace ChaosBot.Database.Entity
|
||||||
|
{
|
||||||
|
[DBEntity("CommandPermissions")]
|
||||||
|
public class CommandPermissions : BaseEntity
|
||||||
|
{
|
||||||
|
[DBPrimaryKey]
|
||||||
|
[DBAutoIncrement]
|
||||||
|
[DBNotNull]
|
||||||
|
[DBUnique]
|
||||||
|
public Nullable<long> id { get; private set; }
|
||||||
|
public string type { get; private set; }
|
||||||
|
public string value { get; private set; }
|
||||||
|
public string cmd { get; private set; }
|
||||||
|
public long guildId { get; private set; }
|
||||||
|
|
||||||
|
public CommandPermissions() {}
|
||||||
|
|
||||||
|
public CommandPermissions(int id, string type, string value, string cmd, long guildId)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
this.type = type;
|
||||||
|
this.value = value;
|
||||||
|
this.cmd = cmd;
|
||||||
|
this.guildId = guildId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CommandPermissions(string type, string value, string cmd, long guildId)
|
||||||
|
{
|
||||||
|
this.type = type;
|
||||||
|
this.value = value;
|
||||||
|
this.cmd = cmd;
|
||||||
|
this.guildId = guildId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static QueryBuilder<CommandPermissions> Query()
|
||||||
|
{
|
||||||
|
return BaseEntity.Query<CommandPermissions>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SetFromRow(DataRow row)
|
||||||
|
{
|
||||||
|
id = (long)row["id"];
|
||||||
|
type = (string)row["type"];
|
||||||
|
value = (string)row["value"];
|
||||||
|
cmd = (string)row["cmd"];
|
||||||
|
guildId = (long) row["guildid"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user