Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [HttpGet("{id}")]
- public async Task<ActionResult<T>> Get(int id)
- {
- return this.repository.Find(x => x.Id == id);
- }
- public virtual async Task<TEntity> Find(Func<TEntity,bool> predicate)
- {
- return await Task.Run(()=> context.Set<TEntity>().FirstOrDefault(predicate));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement