thewar_server/Server/SQL/DeckUnitInfo.cs

38 lines
1.2 KiB
C#

using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations.Schema;
namespace Server.SQL
{
[Table("deck_unit_info", Schema = "gamedb")]
public class DeckUnitInfo
{
public long id { get; set; }
public long unit_id { get; set; }
[JsonIgnore]
public long user_id { get; set; }
public long equip0_id { get; set; }
public long equip1_id { get; set; }
public long equip2_id { get; set; }
public long equip3_id { get; set; }
public long equip4_id { get; set; }
public long equip5_id { get; set; }
public int level { get; set; }
public long exp { get; set; }
}
public class DeckUnitInfoSQL : SQL<DeckUnitInfo>
{
public override DbSet<DeckUnitInfo> table { get; set; }
public override List<DeckUnitInfo> SelectUid(long user_id)
{
return table.Where(data => data.user_id == user_id).ToList();
}
public DeckUnitInfo SelectItem(long user_id, long unit_id)
{
return table.FirstOrDefault(data => (data.user_id == user_id) && (data.id == unit_id));
}
}
}