41 lines
1020 B
C#
41 lines
1020 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using ChaosBot.Database.Entity;
|
|
|
|
namespace ChaosBot.Database.Repository
|
|
{
|
|
public static class RaffleRepository
|
|
{
|
|
private static readonly string Table = "RaffleTable";
|
|
|
|
// public static Raffle[] all()
|
|
// {
|
|
//
|
|
// }
|
|
|
|
public static void insert(Raffle raffle)
|
|
{
|
|
Dictionary<string, object> dict = new Dictionary<string, object>();
|
|
|
|
dict.Add("userId", raffle.userId);
|
|
|
|
Controller.InsertQuery(Table, dict);
|
|
}
|
|
|
|
public static void massInsert(List<Raffle> raffles)
|
|
{
|
|
foreach (var raf in raffles)
|
|
{
|
|
Dictionary<string, object> dict = new Dictionary<string, object>();
|
|
|
|
dict.Add("userId", raf.userId);
|
|
Controller.InsertQuery(Table, dict);
|
|
}
|
|
}
|
|
|
|
// public static void delete()
|
|
// {
|
|
//
|
|
// }
|
|
}
|
|
} |