chaosbot/ChaosBot/Database/Entity/Points.cs

49 lines
1.2 KiB
C#

using System;
using System.Data;
using ChaosBot.Attribute;
namespace ChaosBot.Database.Entity
{
[DBEntity("PointsTable")]
public class Points : BaseEntity
{
[DBPrimaryKey]
[DBAutoIncrement]
[DBNotNull]
[DBUnique]
public Nullable<long> id { get; private set; }
public long points { get; private set; }
public long userId { get; private set; }
public long guildId { get; private set; }
public Points() {}
public Points(long id, long userId, long guildId, int points)
{
this.id = id;
this.userId = userId;
this.guildId = guildId;
this.points = points;
}
public Points(long userId, long guildId, long points)
{
this.points = points;
this.userId = userId;
this.guildId = guildId;
}
public static QueryBuilder<Points> Query()
{
return BaseEntity.Query<Points>();
}
public override void SetFromRow(DataRow row)
{
id = (long)row["id"];
userId = (long)row["userId"];
guildId = (long)row["guildId"];
points = (long)row["points"];
}
}
}