/// <summary> /// Execute Query[T].Where(query).First(); /// </summary> public T First <T>(Query query = null, string collectionName = null) { using (var db = new LiteRepository(_configService.ConnectionString)) { return(db.First <T>(query, collectionName)); } }
/// <summary> /// Execute Query[T].Where(query).First(); /// </summary> public T First <T>(Expression <Func <T, bool> > predicate, string collectionName = null) { using (var db = new LiteRepository(_configService.ConnectionString)) { return(db.First <T>(predicate, collectionName)); } }
public Result <T> First(Query query = null, string collectionName = null) { var result = new Result <T>(); try { result.ResultObject = _liteRepository.First <T>(query, collectionName); } catch (Exception ex) { result.ResultCode = (int)ResultStatusCode.InternalServerError; result.ResultMessage = "Hata Oluştu => " + ex; result.ResultInnerMessage = "Hata Oluştu => " + ex.InnerException; result.ResultStatus = false; } return(result); }
public Todo Get(Guid id) { Todo result; using (var repo = new LiteRepository(_connectionString)) { result = repo.First <Todo>(t => t.Id == id); } return(result); }
protected TAggregate Get <TAggregate, TState>(Guid id, Func <TState, TAggregate> mapping) where TAggregate : class where TState : struct { using (var db = new LiteRepository(_connectionString, _mapper)) { var state = db.First <StateWrapper <TState> >( sw => sw.Id.Equals(id), _collectionName ).State; var aggregate = mapping(state); return(aggregate); } }
public TEntity Get(Expression <Func <TEntity, bool> > filter = null) { return(_liteRepository.First(filter)); }
public T First(Expression <Func <T, bool> > predicate) { return(_liteRepository.First(predicate)); }