Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var entities = await DbContext.SomeEntities
- .NewerThan( query.UpdatedSince )
- .ByIdAsync( query.Id );
- public static IQueryable<SomeEntity> Hankintapaatosehdotukset( this IQueryable<SomeEntity> source, DateTime updatedSince )
- {
- return source.Where( e => e.UpdatedSince >= updatedSince );
- }
- public static async Task<SomeEntity> ByIdAsync( this IQueryable<SomeEntity> source, long id )
- {
- var entity = await source.SingleOrDefaultAsync( t => t.Id == id );
- if ( entity == null ) { throw new NotFoundException( $"Entity not found with ID: {id}" ); }
- return entity;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement