public TFSEntity Find(FSSystemGuid rowId) { using (var dataContext = new FSDataContext <TFSEntity>(_provider)) { return(dataContext.GetByRowId(rowId)); } }
public TFSEntity FirstOrDefault(string where) { using (var dataContext = new FSDataContext <TFSEntity>(_provider)) { return(dataContext.GetFetchNext(where) .FirstOrDefault()); } }
public async Task <TFSEntity> FirstOrDefaultAsync(string where) { using (var dataContext = new FSDataContext <TFSEntity>(_provider)) { return(await Task.FromResult(dataContext.GetFetchNext(where) .FirstOrDefault())); } }
public IEnumerable <FSIdent> Ident( string where = "", string orderBy = "") { using (var dataContext = new FSDataContext <TFSEntity>(_provider)) { var query = dataContext.GetFetchNextPK(where, orderBy); foreach (var(item1, item2) in query) { yield return(new FSIdent(item1, item2)); } } }
public virtual Task <IEnumerable <TFSEntity> > GetAsync( string where = "", string orderBy = "", int?offset = null, int?limit = null, int?loadSize = null) { using (var dataContext = new FSDataContext <TFSEntity>(_provider)) { var query = dataContext.GetFetchNext(where, orderBy, offset, limit); if (loadSize.HasValue) { query = query.TakeWhile((t, index) => index < loadSize); } return(Task.FromResult(query.ToList().AsEnumerable())); } }
public virtual IEnumerable <TFSEntity> Get( string where = "", string orderBy = "", int?offset = null, int?limit = null, int?loadSize = null) { using (var dataContext = new FSDataContext <TFSEntity>(_provider)) { var query = dataContext.GetFetchNext(where, orderBy, offset, limit); if (loadSize.HasValue) { query = query.TakeWhile((t, index) => index <= loadSize); } foreach (var o in query) { yield return(o); } } }