public void Count(QueryableOptions options) { Measure( () => _model.DeserializeItems <Event>(_stream, options.PrefixStyle, 0).Count(), () => _model.AsQueryable <Event>(_stream, options).Count() ); }
public void Count() { Measure( () => _model.DeserializeItems <Event>(_stream, Prefix, 0).Count(), () => _model.AsQueryable <Event>(_stream, Prefix).Count() ); }
public void QueryWithWhereAndSelect() { var q = _model.AsQueryable <Employee>(_stream, Prefix); var linq = from e in q where e.Id % 2 == 0 select new { e.Id, e.Name }; foreach (var e in linq) { Assert.IsTrue(e.Id % 2 == 0); } }
public static IProtobufQueryable <T> AsQueryable <T>(this RuntimeTypeModel model, Stream source, PrefixStyle prefix = PrefixStyle.Base128) { var options = QueryableOptions.GetDefault(); options.PrefixStyle = prefix; return(model.AsQueryable <T>(source, options)); }