oop_II-6/EHEC_Server/EHEC_Server/DatabaseAccess/ResultAccess.cs

35 lines
814 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
2018-06-24 17:36:08 +02:00
using System.ServiceModel;
namespace EHEC_Server.DatabaseAccess
{
public class ResultAccess
{
public bool CreateResult(Result result)
{
try
{
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
{
ctx.Result.Add(result);
ctx.SaveChanges();
}
return true;
}
catch (Exception)
{
return false;
}
}
2018-06-24 17:36:08 +02:00
public List<Result> GetAllResults()
{
using (EHEC_DBEntities ctx = new EHEC_DBEntities())
{
return ctx.Result.ToList();
}
}
}
}