sadomovalex / camlex Goto Github PK
View Code? Open in Web Editor NEWCamlex simplifies creation of CAML queries for SharePoint (2007, 2010, 2013, 2016, 2019, Online) by using expression trees and lambda expressions
License: MIT License
Camlex simplifies creation of CAML queries for SharePoint (2007, 2010, 2013, 2016, 2019, Online) by using expression trees and lambda expressions
License: MIT License
manuel_cabrera[CodePlex]
Hi.
I have generated a TFS Build on a Sharepoint 2010 project, adding a reference to Camlex.NET. This build executes Code Analysis and find the following error:
CA0058 : The referenced assembly 'Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' could not be found. This assembly is required for analysis and was referenced by: (MY_DLL)
I've tried to declare a config file with bindingreference from version 12 to 14 but it doesn't work.
Any idea?
lawalker[CodePlex]
It works, thanks, but this approach kills my OrderBy block in base query and result query doesn`t have any OrderBy element.
Please fix it.
hodzanassredin[CodePlex]
Query = Camlex.Query()
.Where(x =gt x[SPBuiltInFieldId.ContentTypeId] == (DataTypes.ContentTypeId)quot0x010200133EAACD2B222C4E9F0EEA462F9EA480quot)
.OrderBy(x =gt x[SPBuiltInFieldId.Modified]).ToString(),
throws exception
{CamlexNET.NonSupportedExpressionException: Expression 'x =gt new [] {x.get_Item(SPBuiltInFieldId.Modified)}' can not be translated into CAML
at CamlexNET.Impl.GenericTranslator.TranslateOrderBy(LambdaExpression expr)
at CamlexNET.Impl.Query.OrderBy(Expression1 expr)
at CamlexNET.Impl.Query.OrderBy(Expression1 expr)
at ProjectsPrototypeWSP.RecentActivities.GetData(String webUrl)
at ProjectsPrototypeWSP.RecentActivities.OnLoad(EventArgs e)}
vladimirsbogdan[CodePlex]
Hello! Your tool is very useful. Thank you for that!
I have caught an exception with lookup. Version 3.6.0.0. Try to compile:
string stringId = 1;
DataTypes.LookupId lookupId = (DataTypes.LookupId)stringId;
ExpressionFuncSPListItem, bool expr = (x = x[LookupField] == lookupId);
SPQuery cquery = Camlex.Query().Where(expr).ToSPQuery();
enbeznos[CodePlex]
Here is my web method that I call with help of Ajax JQuery. When sending a request I receive 500 error.
Commenting string
string caml = Query () Where (x =gt (string) x [ quotTitlequot] = quotquot!) .ToString ().;
and Web method works get a 200 response.
In the console application it works but in web method CAMLEX does not work. Please tell me why?
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static int CountPromotions(string listName, string configTags)
{
using (SPWeb web = new SPSite(SPContext.Current.Web.Url).OpenWeb())
{
SPList list = web.Lists[listName];
var query = new SPQuery();
string caml =
Camlex.Query()
.Where(x =gt (string)x[quotTitlequot] != quotquot).ToString();
query.Query = caml;
SPListItemCollection listcol = list.GetItems(query);
return listcol.Count;
}
}
rflipper[CodePlex]
I want to modify existing string CAML query and add additional where expression.
I have found a method Camlex.QueryFromString(camlQuery), but cannot understand how to use it.
TimOdell[CodePlex]
I understand the following CAML to retreive all checked-out items.
Query
Where
IsNotNull
FieldRef LookupId='TRUE' Name=CheckoutUser /
/IsNotNull
/Where
/Query
The following Camlex returns
Camlex.Query().Where(x = x[CheckoutUser] != null).ToString(); ;
Query
Where
IsNotNull
FieldRef Name=CheckoutUser /
/IsNotNull
/Where
/Query
How does one get the LookupId=TRUE portion that I need?
Thanks
rhousham[CodePlex]
Hi thanks for the Camlex.net brill piece of software.
I'm working on Camlex.Client 2.2.
This is my query here
var caml =
Camlex.Query().
InnerJoin(x =gt x[CesaDocument.DocType_field].PrimaryList(CESAContext.Documents).ForeignList(CESAContext.DocumentType)).
Where(x =gt (string)x[CesaDocument.RiOID_field] == id).
Scope(ViewScope.RecursiveAll).ToCamlQuery();
It compiles and that works find but the Join code is placed at the end of the query string like so..
ltquerygt
ltwheregtlt/wheregt
lt/querygt
ltjoingt
lt/joingt
This doesn't want to work in sharepoint 2010, which I'm working with.
If you put the ltjoingtlt/joingt at the top then it works (in my tester).
Thanks for your help.
Richard
eyedol[CodePlex]
The code similar to following produces incorrect result:
Camlex.Query().Where(li =gt (bool)li[quotBooleanFlag1quot] ampamp (bool)li[quotBooleanFlag2quot] == booleanFlag)
Need to explicitly compare the field with quottruequot, which is redundant and not much of a high quality coding standard:
Camlex.Query().Where(li =gt (bool)li[quotBooleanFlag1quot] == true ampamp (bool)li[quotBooleanFlag2quot] == booleanFlag)
ibragimdeltorro[CodePlex]
Example inner join List in SharePoint in MSDN
http://msdn.microsoft.com/en-us/library/ee539975.aspx
This will give a huge opportunity, but if use lin-q then problem with large list
youranupama[CodePlex]
Seems like it works with only SharePoint 14 and throw assembly not found exception when used in SharePoint 2013 App.
Try rebuilding the code using updated DLL but it is not working. Any Idea?
haplo69[CodePlex]
If you are interested, I have added support for Taxonomy Fields
kavalirakesh[CodePlex]
Hi
this is excellent framework for CAML.
i got a small problem while i implement Camlex.
var exp = new ListltExpressionltFuncltSPListItem, boolgtgtgt();
exp.Add(x =gt ((CamlexNET.DataTypes.WorkflowStatus)x[status] == (CamlexNET.DataTypes.WorkflowStatus)ddlStatus.SelectedValue));
the dropdown list values are 2, 16, 17
in run time its giving the error
camlex cannot be translated into caml workflow status
Expression 'x =gt (Convert(x.get_Item(value(List_View_Filter_WebPart.VisualWebPart1.VisualWebPart1UserControl+ltgtc__DisplayClass0).status)) = Convert(Convert(value(ASP._controltemplates_list_view_filter_webpart_visualwebpart1_visualwebpart1usercontrol_ascx).ddlStatus.SelectedValue)))'
can not be translated into CAML
davescriven[CodePlex]
Hi,
First, let me say thanks for building this library! I'd really go insane building XML CAML queries without it.
We've been working with the SharePoint Client Object Model for our application and whilst Camlex.NET does a great job of creating basic queries we also wanted to use the .ViewFields functionality. So we've made some small changes do the latest source code to
adapt it to this purpose (source code attached to this work item).
The following (high level) changes were made:
Microsoft.SharePoint references were changed to Microsoft.SharePoint.Client SPListItem type dependencies were updated to ListItem Modified .ToCaml() to only output XML with a surrounding ltViewgt and ltQuerygt elements (since CamlQuery.ViewXml needs this) (and updated the existing unit tests)
Modified .ViewFields methods to return IQuery rather than string (and updated the existing unit tests)
Modified .ToCaml to also output the ltViewFieldsgt element (and updated the existing unit tests)
Commented out unit tests that test for Guid functionality (ListItem.this[Guid] doesn't exist in the Client Object Model)
Commented out unit tests that test for int support (ListItem.this[int] doesn't exist in the Client Object Model)
Commented out unit tests that test for specific field Id (the SPBuiltInFieldId class does not exist in the Client Object Model)
These changes allow us to write code like...
Camlex.Query().ViewFields(l =gt l[quotTitlequot]).Where(l =gt (string)l[quotTitlequot] == quotFooBarquot);
and get a query that will work with CamlQuery in the managed client object model:
ltViewgt
ltViewFieldsgt
ltFieldRef Name=quotTitlequot /gt
lt/ViewFieldsgt
ltQuerygt
ltWheregt
ltEqgt
ltFieldRef Name=quotTitlequot /gt
ltValue Type=quotTextquotgtFooBarlt/Valuegt
lt/Eqgt
lt/Wheregt
lt/Querygt
lt/Viewgt
So, the point of this work item is to really propose that Camlex supports the Client Object Model out-of-the-box. The changes required are actually quite minor although the differences around ViewFields are definitely incompatible. I'm not suggesting that you
use the code that I've provided (I haven't put any effort into having the same assembly support both the COM and Server APIs) but it does demonstrate how little work is required.
Hopefully you guys have the time do to this.
Cheers,
Scriv
thaihstbmt[CodePlex]
Hi all,
I build dynamic query like bellow, but there is an error Entry point was not found.
anyone help me, thanks.
var MainExpr = new ListExpressionFuncListItem, bool();
MainExpr.Add(x = ((string)x[ChucDanh]).Contains(thai));
MainExpr.Add(x = x[DonVi] == (DataTypes.LookupId)1);
string camle=Camlex.Query().WhereAll(MainExpr).ToString();
robbert1[CodePlex]
var expressions = new ListltExpressionltFuncltSPListItem, boolgtgtgt();
var lookupids = new Listltstringgt{ quot1quot, quot2quot, quot3quot };
foreach (var lookupid in lookupids)
{
expressions.Add(x =gt x[quotMyFieldquot] == (DataTypes.LookupId) lookupid);
}
foreach(var expr in expressions)
Console.WriteLine(Camlex.Query().Where(expr).ToString());
This generates queries, all with the last lookupid of the query:
ltWheregt
ltEqgt
ltFieldRef Name=quotMyFieldquot LookupId=quotTruequot /gt
ltValue Type=quotLookupquotgt3lt/Valuegt
lt/Eqgt
lt/Wheregt
ltWheregt
ltEqgt
ltFieldRef Name=quotMyFieldquot LookupId=quotTruequot /gt
ltValue Type=quotLookupquotgt3lt/Valuegt
lt/Eqgt
lt/Wheregt
ltWheregt
ltEqgt
ltFieldRef Name=quotMyFieldquot LookupId=quotTruequot /gt
ltValue Type=quotLookupquotgt3lt/Valuegt
lt/Eqgt
lt/Wheregt
patrickpenn[CodePlex]
Hi,
how can i set something like this with Camlex.NET?
Value Type='DateTime' IncludeTimeValue='True'/Value
with kind regards
Patrick
ttittoCode[CodePlex]
I need to translate normal queries from LINQ to Camlex queries but some problems occured.
for example I have the following expression c = c.ShowInInvoicesGrid == true and I try to translate it to x = (bool)x[CategoriesShowInInvoices] == true. For this goal I am using a class inheriter of the ExpressionVisitor with the following
implementation:
class VisitorListItem, T, TProxy : ExpressionVisitor
{
ParameterExpression parameter;
Type initialMemberType;
private IListItemDataUtilityT, TProxy listItemDataUtility;
public Visitor(ParameterExpression listItemParam, IListItemDataUtilityT, TProxy listItemDataUtility)
{
this.parameter = listItemParam;
this.listItemDataUtility = listItemDataUtility;
}
protected override Expression VisitParameter(ParameterExpression node)
{
return this.parameter;
}
protected override Expression VisitMember(MemberExpression node)
{
if (node.Member.MemberType == System.Reflection.MemberTypes.Property)
{
MemberExpression memberExpression = null;
var memberName = node.Member.Name;
var memberType = node.Member.MemberType;
var internalName = this.listItemDataUtility.GetFieldInternalNameFromProperty(memberName);
var newProperty = (Expression.Convert(Expression.Property(this.parameter, Item, new Expression[] { Expression.Constant(internalName) }), typeof(Boolean)));
return newProperty;
}
else
{
return base.VisitMember(node);
}
}
}
Visitor class is used in the following method to generate translated expressions:
private ExpressionFuncListItem, bool ConvertExpression(ExpressionFuncT, bool expr)
{
var listItemParam = Expression.Parameter(typeof(ListItem));
var visitor = new VisitorListItem, T, TProxy(listItemParam, this.listItemDataUtility);
var resultingExpression = visitor.Visit(expr.Body);
ExpressionFuncListItem, bool resultingLambda = Expression.LambdaFuncListItem, bool(resultingExpression, listItemParam);
return resultingLambda;
}
the expressions are then moved in a list and passed to the camlex WhereAll() clause:
caml = caml.WhereAll(andListItemExpressions);
At this last line I receive the NonSupportedExpressionException: An exception of type 'CamlexNET.NonSupportedExpressionException' occurred in Camlex.Client.dll but was not handled in user code
Additional information: Expression 'x = ((Convert(Param_0.Item[CategoriesShowInInvoices]) == True) AndAlso (Convert(Param_1.Item[CategoriesShowInTemplates]) == True))' can not be translated into CAML
sadomovalex[CodePlex]
See comment from wideserg in
https://camlex.codeplex.com/discussions/353158.
VeryWell[CodePlex]
Hello!
How can I make CAML for MultiLookup field?
ltQuerygt
ltWheregt
ltEqgt
ltFieldRef Name='MultiLookup' /gt
ltValue Type='LookupMulti'gtadminlt/Valuegt
lt/Eqgt
lt/Wheregt
lt/Querygt
Great tool! Thanks in advance!
Vitaly.
sadomovalex[CodePlex]
In camlex-online.org the following query is not transformed to C#:
ltQuerygt
ltWheregt
ltLeqgt
ltFieldRef Name='myStartDate' /gt
ltValue Type='DateTime'gtltToday /gtlt/Valuegt
lt/Leqgt
lt/Wheregt
lt/Querygt
pweissbrod[CodePlex]
Consider the following query. Customer is a field that allows multiple SPUser
ltQuerygt
ltWheregt
ltOrgt
ltContainsgt
ltFieldRef Name='Customer' /gt
ltValue Type='UserMulti'gtfoolt/Valuegt
lt/Containsgt
ltEqgt
ltFieldRef Name='Requestor' LookupId='TRUE' /gt
ltValue Type='User'gt12lt/Valuegt
lt/Eqgt
lt/Orgt
lt/Wheregt
lt/Querygt
senglory[CodePlex]
This is my code:
string[] barcodes = new string[] {
20011713,
12312312
};
var barCodeIntName=BarCode;
var expressions = new ListExpressionFuncSPListItem, bool();
foreach (string bc in barcodes)
expressions.Add(srch = ((string)srch[barCodeIntName]) == bc);
var caml = Camlex.Query().WhereAny(expressions).ToString();
The resulting caml value is the following:
Where Or Eq FieldRef Name=BarCode / Value Type=Text20011713/Value /Eq Eq FieldRef Name=BarCode / Value Type=Text20011713/Value /Eq /Or/Where
Why it forgets about the 2nd value? Or perhaps I'm doing something wrong? The isues's happening with Camlex 3.1 and 3.5.
auxcom[CodePlex]
First Thanks alot for the great tool!
This could be a simple question. Having this error: SPListItem could not be found
Need to know what assembly to reference?
I am using Sharepoint 2010 Client Object (version 14.0.4762.1000) that I reference by Nuget.
And what is the difference between Camlex Client and non-client version?
n0e[CodePlex]
Camlex fails when trying to parse a query like this:
ltWheregt
ltIngt
ltFieldRef Name=quotIDquot /gt
ltValuesgt
ltValue Type=quotCounterquotgt0lt/Valuegt
ltValue Type=quotCounterquotgt1lt/Valuegt
ltValue Type=quotCounterquotgt2lt/Valuegt
lt/Valuesgt
lt/Ingt
lt/Wheregt
Trying to use something similar in VS code gives compiler warnings:
Camlex.Query().Where(x =gt ids.Contains((DataTypes.Counter)x[quotIDquot])).ToString();
speciesxx[CodePlex]
hi all,
i'm using the following syntax for my query building:
SPUser currentUserLocal;
var expressions = new ListExpressionFuncSPListItem, bool();
foreach (string loginName in ...))
{
string userId = loginName;
expressions.Add(x = (string)x[SPFieldNames.CaseResponsible.ToString()] == ((DataTypes.LookupId)userId).ToString());
}
this results in a null pointer exception once I try to generate the query.
Also I notice in the debugger that the expression
(DataTypes.LookupId)userId
results in null.
If I look in the source code for the class BaseFieldType I see null is returned?
And the class 'LookupId' has a todo in it. Am I using the wrong version or something?
As the main page states you can use LookupId in the query builder (quick start section)
public class BaseFieldType
{
public static explicit operator BaseFieldType(string s) { return null; }
}
public class LookupId : BaseFieldTypeWithOperators
{
// todo: allow cast from integer to LookupId
// public static explicit operator LookupId(int id)
// {
// return null;
// }
}
enbeznos[CodePlex]
Here is my web method that I call with help of Ajax JQuery. When sending a request I receive 500 error.
Commenting string
string caml =Query().Where(x = (string)x[Title] != ).ToString();
and Web method works get a 200 response.
In the console application it works but in web method CAMLEX does not work. Please tell me why?
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static int CountPromotions(string listName, string configTags)
{
using (SPWeb web = new SPSite(SPContext.Current.Web.Url).OpenWeb())
{
SPList list = web.Lists[listName];
var query = new SPQuery();
string caml =
Camlex.Query()
.Where(x = (string)x[Title] != ).ToString();
query.Query = caml;
SPListItemCollection listcol = list.GetItems(query);
return listcol.Count;
}
}
ibondy[CodePlex]
Hello,
I really like Camlex and I integrated it into my list based repository I am working on.
Would be really helpfull if you could add ToSPQuery() function.
i.e.:
var q = Camlex.Query().Where(p=gt(int)p[ID]==1);
var items = List.GetItems(q.ToSPQuery);
This would save time of declaring new SPQuery and passing query string in.
Thanks for consideration.
rbev[CodePlex]
I came across this very quickly but it might be worth considering detection of boolean fileds in the where expression.
The following is currently valid, but reshareper complains about it (and will helpfully quotfixquot it with a single click)
Camlex.Query().Where(x =gt (bool)x[quotFieldquot] == true ampamp (bool)x[quotField2quot] == true)
Whereas my fist instinct threw a runtime exception:
Camlex.Query().Where(x =gt (bool)x[quotField1quot] ampamp (bool)x[quotField2quot])
It would be worth not requiring the explicit comparison for boolean columns in the query.
Pavel_Kudishin[CodePlex]
Following method is very slow:
IQuery query = Camlex.Query().WhereAny(expressions);
where
IEnumerableltExpressionltFuncltSPListItem, boolgtgtgt expressions = claimIds.Selectltint, ExpressionltFuncltSPListItem, boolgtgtgt(claimId =gt (x =gt ((int)x[quotIDquot] == claimId)));
int[] claimIds - array of any integers.
If claimIds.Length==20, then WhereAny takes 10 seconds.
If claimIds.Length==15, then WhereAny takes 4 seconds.
If claimIds.Length==10, then WhereAny takes 2 seconds.
avishnyakov[CodePlex]
We'd like to compare strings as per the following query:
x = x[DocDate] = from x[DocDate] = to
from / to are strings, so we are getting Operator '=' cannot be applied to operands of type 'object' and 'string'
The following one goes the sa,me way:
x = (string)x[DocDate] = from (string)x[DocDate] = to
Is there any way to overcome that?
rflipper[CodePlex]
I want to modify existing string CAML query and add additional where expression.
rpohomenko[CodePlex]
Is Membership implemented?
http://msdn.microsoft.com/en-us/library/office/aa544234(v=office.15).aspx
PhillySPDev[CodePlex]
I'm trying to use the IN operator with a LookupId, but it seems the IN operator will only work with integers or strings or simple datatypes.
What's the solution? Or do I have to use the OR operator instead?
Normally, syntax with .Contains() as below would work, but because the Contains extension method is looking for, in this case, int[], not LookupId[].
int[] lookupIds = {1, 2, 3};
Where(x = lookupIds.Contains((DataTypes.LookupId)x[LookupFieldTitle]))
IAfanasov[CodePlex]
sadomovalex wrote:
hi currently if several Where... methods (Where, WhereAny or WhereAll) are used in the single call chain, only the last method is actually applied.
Hi, we created rule in SPCAFContrib for this case and use text from this thread in help page.
https://spcafcontrib.codeplex.com/wikipage?title=CSC510224_CamlexQueryDoubleWhere
Is it OK?
sadomovalex[CodePlex]
test
avishnyakov[CodePlex]
Hello team,
How would say the following query in C#? What's the way to include ltToday /gt as a value for date time filter?
ltLeqgt
ltFieldRef Name='myStartDate' /gt
ltValue Type='DateTime'gtltToday /gtlt/Valuegt
lt/Leqgt
powareverb[CodePlex]
First of all, thanks so much for the library. It's been immensely helpful for many projects so far, much better than dealing with CAML strings for sure.
So I'm expecting I'm doing something silly here, but here's the story anyway. Working on CAMLEX 3.3.
I've a pretty typical use case - a simple enough query with a bunch of derivatives. To reduce code, I'm using the dynamic queries syntax to add to the existing query.
So an example base query:
var simple = CamlexNET.Camlex.Query()
.Where(
p =gt p[quotHelloquot] != null
);
... and another query to combine:
var success = CamlexNET.Camlex.Query()
.WhereAny(
simple.ToString(),
p =gt p[quotTestquot] != null
);
Console.WriteLine(success.ToString());
Which gives you an output like this:
ltWheregt
ltOrgt
ltIsNotNullgt
ltFieldRef Name=quotTestquot /gt
lt/IsNotNullgt
ltIsNotNullgt
ltFieldRef Name=quotHelloquot /gt
lt/IsNotNullgt
lt/Orgt
lt/Wheregt
However, this technique doesn't seem to work for more complex queries, such as the following:
var expiryDate = quotExpiryDatequot;
var commenceDate = quotCommencequot;
var docFolder = quotDocFolderquot;
var ret = CamlexNET.Camlex.Query()
.Where(
p =gt (p[expiryDate] == null
|| p[expiryDate] gt (CamlexNET.DataTypes.DateTime)CamlexNET.Camlex.Today) ampamp
(p[commenceDate] == null
|| p[commenceDate] lt= (CamlexNET.DataTypes.DateTime)CamlexNET.Camlex.Today)
)
.GroupBy(p =gt p[docFolder]);
Console.WriteLine(ret.ToString());
You'll see that this generates CAML XML just fine, but when you go to add to it using the same method:
var problem = CamlexNET.Camlex.Query().WhereAny(
ret.ToString(),
p =gt p[quotTestquot] != null
);
Console.WriteLine(problem.ToString());
The last code chunk returns a quotIncorrectCamlExceptionquot, siting that quotCaml specified for tag 'Where' can not be translated to codequot. I'd suggest it's a bug in the CAML to IQuery translation, because throwing the following XML into camlex-online
also fails (yet this is the CAML that is generated by the quotretquot query above).
ltWheregt
ltAndgt
ltOrgt
ltIsNullgt
ltFieldRef Name=quotExpiryDatequot /gt
lt/IsNullgt
ltGtgt
ltFieldRef Name=quotExpiryDatequot /gt
ltValue Type=quotDateTimequotgt
ltToday /gt
lt/Valuegt
lt/Gtgt
lt/Orgt
ltOrgt
ltIsNullgt
ltFieldRef Name=quotCommencequot /gt
lt/IsNullgt
ltLeqgt
ltFieldRef Name=quotCommencequot /gt
ltValue Type=quotDateTimequotgt
ltToday /gt
lt/Valuegt
lt/Leqgt
lt/Orgt
lt/Andgt
lt/WheregtltGroupBygt
ltFieldRef Name=quotDocFolderquot /gt
lt/GroupBygt
kekscho[CodePlex]
Hi,
I am trying to use WhereAny to build a dynamic CAML query - I want to get all items from a list, for which in any of the columns a search string occurs. Here is my code:
var expressions = new ListExpressionFuncSPListItem, bool();
foreach (string cn in columnNames)
{
string columnName = cn;
string searchFor = this.searchField.Text; // searchField is a TextBox
expressions.Add(x = x[columnName].ToString().Contains(searchFor));
}
var camlQuery = Camlex.Query().WhereAny(expressions).ToString();
When the WhereAny() is called, I get an exception:
Expression type 'Call' is not supported .
Here is the stack trace:
[NonSupportedExpressionTypeException: Expression type 'Call' is not supported]
CamlexNET.Impl.Factories.AnalyzerFactory.Create(LambdaExpression expr) 1001
CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr) 211
CamlexNET.Impl.Operations.OrElse.OrElseAnalyzer.IsValid(LambdaExpression expr) 16
CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr) 236
CamlexNET.Impl.Operations.OrElse.OrElseAnalyzer.IsValid(LambdaExpression expr) 16
CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr) 236
CamlexNET.Impl.Operations.OrElse.OrElseAnalyzer.IsValid(LambdaExpression expr) 16
CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr) 236
CamlexNET.Impl.Operations.OrElse.OrElseAnalyzer.IsValid(LambdaExpression expr) 16
CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr) 236
CamlexNET.Impl.Operations.OrElse.OrElseAnalyzer.IsValid(LambdaExpression expr) 16
CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr) 236
CamlexNET.Impl.Operations.OrElse.OrElseAnalyzer.IsValid(LambdaExpression expr) 16
CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr) 236
CamlexNET.Impl.Operations.OrElse.OrElseAnalyzer.IsValid(LambdaExpression expr) 16
CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr) 236
CamlexNET.Impl.Operations.OrElse.OrElseAnalyzer.IsValid(LambdaExpression expr) 16
CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr) 236
CamlexNET.Impl.Operations.OrElse.OrElseAnalyzer.IsValid(LambdaExpression expr) 16
CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr) 236
CamlexNET.Impl.Operations.OrElse.OrElseAnalyzer.IsValid(LambdaExpression expr) 16
CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr) 236
CamlexNET.Impl.Operations.OrElse.OrElseAnalyzer.IsValid(LambdaExpression expr) 16
CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr) 236
CamlexNET.Impl.Operations.OrElse.OrElseAnalyzer.IsValid(LambdaExpression expr) 16
CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr) 236
CamlexNET.Impl.Operations.OrElse.OrElseAnalyzer.IsValid(LambdaExpression expr) 16
CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr) 236
CamlexNET.Impl.Operations.OrElse.OrElseAnalyzer.IsValid(LambdaExpression expr) 16
CamlexNET.Impl.GenericTranslator.TranslateWhere(LambdaExpression expr) 38
CamlexNET.Impl.Query.WhereAny(IEnumerable`1 expressions) 78
Any idea what the problem might be? Am I doing something wrong?
Thanks,
Vasil
omlin[CodePlex]
IN operation is now supported:
Support for IN CAML operation: Camlex 3.5 and Camlex.Client 1.3 are released.
zyzil[CodePlex]
There is not a way currently to express the override attribute of an order by clause such as this example:
ltOrderBy Override='TRUE'gtltFieldRef Name='ID'gtlt/OrderBygt
I tried using the overload that accepts existingOrderBy; however, it strips the Override attribute off. Also, since there is no way to only include an existingOrderBy field it duplicated the FieldRef element.
syoungPB[CodePlex]
When using Camlex.Client the Query.ToString method has one overload which gives the option of including the View xml tag. If the option is set to false I would expect both the Query and Where tags to be output but only the Where tag is output.
jcoryat[CodePlex]
Tried converting the following query to C# using camlex-online. Said it could not do it. Does camlex not support the quotInquot?
ltQuerygt
ltWheregt
ltOrgt
ltOrgt
ltIngt
ltFieldRef Name='Category' /gt
ltValuesgt
ltValue Type='Lookup'gtLaptoplt/Valuegt
ltValue Type='Lookup'gtLaptop Accesorieslt/Valuegt
lt/Valuesgt
lt/Ingt
ltEqgt
ltFieldRef Name='Status' /gt
ltValue Type='Choice'gtInventorylt/Valuegt
lt/Eqgt
lt/Orgt
ltEqgt
ltFieldRef Name='Title' /gt
ltValue Type='Text'gtlaptop namelt/Valuegt
lt/Eqgt
lt/Orgt
lt/Wheregt
lt/Querygt
vtimashkov[CodePlex]
Signature of this method could also have following overrides:
ViewFields(params string fieldNames);
ViewFields(IEnumerable fielNames);
Sever[CodePlex]
I use Camlex 3.2 and cannot call GroupBy without specifying group limit. The following code throws an exception of type CamlexNET.NonSupportedExpressionException:
Camlex.Query().GroupBy(x =gt new[] { x[quotSomeFieldquot] }, true);
bart_advantive[CodePlex]
When you use DateRangesOverlap and generate the CAML query is puts out: DataRangesOverlap
Namespace: CamlexNET.Impl.Operations.DataRangesOverlap
Class: DataRangesOverlapOperation : OperationBase
Method: ToResult()
geirsag[CodePlex]
Hi, great work on the Caml builder :)
I'm having some trouble using the Camlex.Client ViewFields, so I thought I would take a look in the source code, but I am only able to find the code for Camlex.NET (server object model). Is the source code for Camlex.Client available?
hodzanassredin[CodePlex]
Sample code Query = Camlex.Query()
.Where(x =gt
(x[SPBuiltInFieldId.ContentTypeId] == (DataTypes.ContentTypeId)WikiContentTypeId ampamp ShowWikiItems)
ampamp (x[SPBuiltInFieldId.ContentTypeId] == (DataTypes.ContentTypeId)BlogContentTypeId ampamp ShowBlogItems)
ampamp (x[SPBuiltInFieldId.ContentTypeId] == (DataTypes.ContentTypeId)ForumContentTypeId ampamp ShowForumItems)
)
throws exception
{CamlexNET.NonSupportedExpressionTypeException: Expression type 'MemberAccess' is not supported
at CamlexNET.Impl.Factories.AnalyzerFactory.Create(LambdaExpression expr)
at CamlexNET.Impl.CompositeExpressionBaseAnalyzer.isExpressionValid(Expression subExpr, ParameterExpression lambdaParam)
at CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr)
at CamlexNET.Impl.Operations.AndAlso.AndAlsoAnalyzer.IsValid(LambdaExpression expr)
at CamlexNET.Impl.CompositeExpressionBaseAnalyzer.isExpressionValid(Expression subExpr, ParameterExpression lambdaParam)
at CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr)
at CamlexNET.Impl.Operations.AndAlso.AndAlsoAnalyzer.IsValid(LambdaExpression expr)
at CamlexNET.Impl.CompositeExpressionBaseAnalyzer.isExpressionValid(Expression subExpr, ParameterExpression lambdaParam)
at CamlexNET.Impl.CompositeExpressionBaseAnalyzer.IsValid(LambdaExpression expr)
at CamlexNET.Impl.Operations.AndAlso.AndAlsoAnalyzer.IsValid(LambdaExpression expr)
at CamlexNET.Impl.GenericTranslator.TranslateWhere(LambdaExpression expr)
at CamlexNET.Impl.Query.Where(Expression`1 expr)
at ProjectsPrototypeWSP.RecentActivities.GetData(String webUrl)
at ProjectsPrototypeWSP.RecentActivities.OnLoad(EventArgs e)}
stefh[CodePlex]
The following query with 2 'Where' clauses:
string xml = Camlex.Query()
.Where(x =gt ((string)x[quotTitlequot]).Contains(quotVisualquot))
.Where(x =gt ((DateTime)x[quotCreatedquot]) gt new DateTime(2010, 09, 01))
.ToString();
creates an XML string containing only the last Where which is not correct!
ltQuerygtltWheregtltGtgtltFieldRef Name=\quotCreated\quot /gtltValue Type=\quotDateTime\quotgt2010-09-01T00:00:00Zlt/Valuegtlt/Gtgtlt/Wheregtlt/Querygt
It should be:
ltQuerygtltWheregtltAndgtltGtgtltFieldRef Name=\quotCreated\quot /gtltValue Type=\quotDateTime\quotgt2010-09-01T00:00:00Zlt/Valuegtlt/GtgtltContainsgtltFieldRef Name=\quotTitle\quot /gtltValue Type=\quotText\quotgtVisuallt/Valuegtlt/Containsgtlt/Andgtlt/Wheregtlt/Querygt
Please fix this
int[] data = new int[] { 1, 3, 5, 10 };
int[] data2 = data
.Where(i =gt i lt 5)
.Where(i =gt i gt 1)
.ToArray();
// data2[0] = 3
data2.Dump();
Hi Any chance of adding an aggregations options.
https://piyushksingh.com/2016/11/21/retrieve-grouped-listitems-sharepoint/
Great Project
Thanks
Richard
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.