37 lines
1.1 KiB
C#
37 lines
1.1 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 int id { get; set; }
|
|
[JsonIgnore]
|
|
public int user_id { get; set; }
|
|
public int unit_data_id { get; set; }
|
|
public int equip0_id { get; set; }
|
|
public int equip1_id { get; set; }
|
|
public int equip2_id { get; set; }
|
|
public int equip3_id { get; set; }
|
|
public int equip4_id { get; set; }
|
|
public int equip5_id { get; set; }
|
|
public int exp { get; set; }
|
|
}
|
|
|
|
public class DeckUnitInfoSQL : SQL<DeckUnitInfo>
|
|
{
|
|
public override DbSet<DeckUnitInfo> table { get; set; }
|
|
|
|
public override List<DeckUnitInfo> SelectUid(int user_id)
|
|
{
|
|
return table.Where(data => data.user_id == user_id).ToList();
|
|
}
|
|
public DeckUnitInfo SelectItem(int user_id, int unit_id)
|
|
{
|
|
return table.FirstOrDefault(data => (data.user_id == user_id) && (data.id == unit_id));
|
|
}
|
|
}
|
|
}
|