Creating endpoint that allows for student update

This commit is contained in:
2019-04-27 15:23:12 -04:00
parent 1a95acac01
commit 8cacaa36ce
7 changed files with 88 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BrightGlimmer.Data.Interfaces
{
@@ -18,5 +19,7 @@ namespace BrightGlimmer.Data.Interfaces
IQueryable<T> Get();
T Get(Guid id);
Task<T> GetAsync(Guid id);
}
}

View File

@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BrightGlimmer.Data.Repositories
{
@@ -43,5 +44,10 @@ namespace BrightGlimmer.Data.Repositories
{
return context.Set<T>().Find(id);
}
public virtual async Task<T> GetAsync(Guid id)
{
return await context.Set<T>().SingleAsync(x => x.Id == id);
}
}
}