public override JsStoreData LoadList(string entityType, int start, int limit, JsFilter[] filter, JsSorter[] sort, string structureName, JsWorkflowIdentity workflowIdentity, JsWorkflowInstanceIdentity workflowInstanceIdentity) { var structureDataProvider = StructureDataProviders[structureName]; var loadListQuery = QueryDeserializer.DeserializeListQuery(structureDataProvider.RecordStructure, start, limit, filter, sort); return(((IListDataLoader)structureDataProvider).LoadList(loadListQuery)); }
private static IQueryable GetQueryable <TEntity>(DomainServiceDescription domainServiceDescription, ServiceQuery query) { if (query != null && query.QueryParts != null && query.QueryParts.Any()) { IQueryable queryable = Enumerable.Empty <TEntity>().AsQueryable(); return(QueryDeserializer.Deserialize(domainServiceDescription, queryable, query.QueryParts)); } return(null); }
private static void AccessMember(Type entityType, string memberToAccess) { IQueryable <EntityWithExcludedMember> queryable = new EntityWithExcludedMember[0].AsQueryable(); List <ServiceQueryPart> queryParts = new List <ServiceQueryPart>() { new ServiceQueryPart("where", String.Format("it.{0} == \"Whatever\"", memberToAccess)) }; ExceptionHelper.ExpectInvalidOperationException(delegate { QueryDeserializer.Deserialize(DomainServiceDescription.GetDescription(typeof(QueryDeserializerDomainService)), queryable, queryParts); }, string.Format(CultureInfo.CurrentCulture, System.Linq.Dynamic.Resource.UnknownPropertyOrField, memberToAccess, entityType.Name)); }
public void TestConstructorAccessChecked() { IQueryable <EntityWithExcludedMember> queryable = new EntityWithExcludedMember[0].AsQueryable(); List <ServiceQueryPart> queryParts = new List <ServiceQueryPart>() { new ServiceQueryPart("where", "it.Double.ToString() == String('a', 1000)") }; ExceptionHelper.ExpectException <ParseException>(delegate { QueryDeserializer.Deserialize(DomainServiceDescription.GetDescription(typeof(QueryDeserializerDomainService)), queryable, queryParts); }, string.Format(CultureInfo.CurrentCulture, System.Linq.Dynamic.Resource.MethodsAreInaccessible + " (at index 24)", typeof(String).Name)); }
public void TestExponents() { IQueryable <EntityWithExcludedMember> queryable = new EntityWithExcludedMember[] { new EntityWithExcludedMember() { Key = 1, Double = 2E+2 }, new EntityWithExcludedMember() { Key = 2, Double = 2E+3 }, }.AsQueryable(); List <ServiceQueryPart> queryParts = new List <ServiceQueryPart>() { new ServiceQueryPart("where", "it.Double < 2.5E+2") }; queryable = (IQueryable <EntityWithExcludedMember>)QueryDeserializer.Deserialize(DomainServiceDescription.GetDescription(typeof(QueryDeserializerDomainService)), queryable, queryParts); Assert.AreEqual(1, queryable.Count()); Assert.AreEqual(1, queryable.Single().Key); }