Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. [HttpGet("{id}")]
  2. public async Task<ActionResult<T>> Get(int id)
  3. {
  4. return this.repository.Find(x => x.Id == id);
  5. }
  6.  
  7. public virtual async Task<TEntity> Find(Func<TEntity,bool> predicate)
  8. {
  9. return await Task.Run(()=> context.Set<TEntity>().FirstOrDefault(predicate));
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement