Creating endpoint that allows for student update
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user