Wireup window with access methods + refaktor structure

This commit is contained in:
2020-03-22 21:52:02 +01:00
parent b1e62e829e
commit 88bd9b894a
16 changed files with 230 additions and 39 deletions

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
using TrackerLibrary.Models;
namespace TrackerLibrary.DataAccess
{
public interface IDataConnection
{
PrizeModel CreatePrize(PrizeModel model);
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace TrackerLibrary.DataAccess
{
public class SqlConnector : IDataConnection
{
// TODO - Make the CreatePrize method actually save to the database
/// <summary>
/// Saves a prize to the database
/// </summary>
/// <param name="model">The prize information.</param>
/// <returns>The prize information, including the unique identifier.</returns>
public Models.PrizeModel CreatePrize(Models.PrizeModel model)
{
model.Id = 1;
return model;
}
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
using TrackerLibrary.Models;
namespace TrackerLibrary.DataAccess
{
public class TextConnector : IDataConnection
{
// TODO - Wire up the createPrize for textFiles
public PrizeModel CreatePrize(PrizeModel model)
{
model.Id = 1;
return model;
}
}
}