49 lines
1.2 KiB
C#
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<int> id { get; private set; }
|
|
public int points { get; private set; }
|
|
public long userId { get; private set; }
|
|
public long guildId { get; private set; }
|
|
|
|
public Points() {}
|
|
|
|
public Points(int 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, int 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 = (int)row["id"];
|
|
userId = (long)row["userId"];
|
|
guildId = (long)row["guildId"];
|
|
points = (int)row["points"];
|
|
}
|
|
}
|
|
} |