Skip to content

tim-mcqueen-ttec/Object2Soql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Object2Soql

Object2Soql is a library to convert strongly typed C# expressions to a SOQL query sintax.

Installation

TBD

pip install foobar

Usage

using Object2Soql;

// SELECT MyProperty From MyClass OFFSET 2;
var query = Soql.From<TestClass>().Select((x)=>x.MyProperty).Skip(2).Build();

// SELECT MyProperty WHERE MyEnum = 'Case B' AND MyInt >= 2 From MyClass;
var query = Soql.From<TestClass>().Select((x)=>x.MyProperty).Where((x)=>x.MyEnum == Enums.CaseB && x.MyInt > 2)Build();

// SELECT MyProperty, MyChild.ItsProperty From MyClass;
var query = Soql.From<TestClass>().Select((x)=> new{ x.MyProperty, x.Child.Property }).Build();

Available Methods

Select

Where

OrderBy

ThenBy

Take

Skip

GroupBy

Include

When no projection is done using Select the library will automaticall include all non-complex properties in the projection. Include serves to specify a single complext property and include all its non-complext properties in the projection. This method my be called several times.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%