public int Count <T>(string filteringQuery = null) { Class @class = this.GetValidatedClass <T>(); Culture frontendDefaultCulture = this.requestHandler.GetService <ICultureManager>().GetFrontendDefaultCulture(); Params @params = new ParamsFactory(this.requestHandler).Create(filteringQuery, @class.Id, null, null, null, null); return(serializedObjectRepository.CountByCultureIdAndClassId(frontendDefaultCulture.Id, @class.Id, @params)); }
public IEnumerable <T> All <T>(string filteringQuery = null, string sortingMemberCode = null, string sortingDirection = null, int?pagingSkip = null, int?pagingTake = null) { Class @class = this.GetValidatedClass <T>(); Culture frontendDefaultCulture = this.requestHandler.GetService <ICultureManager>().GetFrontendDefaultCulture(); Params @params = new ParamsFactory(this.requestHandler).Create(filteringQuery, @class.Id, sortingMemberCode, sortingDirection, pagingSkip, pagingTake); IEnumerable <SerializedObject> serializedObjects = this.serializedObjectRepository.FilteredByCultureIdAndClassId( frontendDefaultCulture.Id, @class.Id, @params ); ObjectDirector objectDirector = new ObjectDirector(this.requestHandler); return(serializedObjects.Select( so => { StronglyTypedObjectBuilder <T> objectBuilder = new StronglyTypedObjectBuilder <T>(); objectDirector.ConstructObject(objectBuilder, so); return objectBuilder.Build(); } )); }