2023-10-10 18:18:17 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using DataAccess.DbAccess;
|
|
|
|
|
using DataAccess.Models;
|
|
|
|
|
|
|
|
|
|
namespace DataAccess.Data;
|
|
|
|
|
|
|
|
|
|
public class WunschInfoData
|
|
|
|
|
{
|
|
|
|
|
private readonly ISqlDataAccess _db;
|
|
|
|
|
|
|
|
|
|
public WunschInfoData(ISqlDataAccess db)
|
|
|
|
|
{
|
|
|
|
|
_db = db;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task AddWunschInfoAsync(WunschInfoModel wunschInfo)
|
|
|
|
|
{
|
|
|
|
|
var id = await _db.LoadData<int, WunschInfoModel>("dbo.spWunschInfo_Insert", wunschInfo);
|
|
|
|
|
wunschInfo.Id = id.Single();
|
|
|
|
|
}
|
2023-10-10 18:56:05 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gibt die WunschInfo mit der gegebenen Id zurück.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="wunschId">Die Id der zu ladenen WunschInfo</param>
|
|
|
|
|
/// <returns>Die WunschInfo mit der gegebenen Id</returns>
|
|
|
|
|
public async Task<WunschInfoModel> GetWunschInfoAsync(int wunschId)
|
|
|
|
|
{
|
|
|
|
|
var wunschInfo = await _db.LoadData<WunschInfoModel, dynamic>("dbo.spWunschInfo_Get", new { Id = wunschId });
|
|
|
|
|
return wunschInfo.Single();
|
|
|
|
|
}
|
2023-10-10 18:18:17 +02:00
|
|
|
|
}
|