anthonyreilly / NetCoreForce

Salesforce REST API toolkit for .NET Standard and .NET Core
MIT License
111 stars 63 forks source link

AsyncQueryProviders #2

Closed srigaux closed 6 years ago

srigaux commented 6 years ago

The goal is to provide a way to query Salesforce objects in a LINQ like way:

    var singleCase = await client
                    .Query<SfCase>()
                    .Select(c => new SfCase
                    {
                        Id = c.Id,
                        CaseNumber = c.CaseNumber,
                        SystemModstamp = c.SystemModstamp,
                        Account = new SfAccount
                        {
                            Name = c.Account.Name,
                            SystemModstamp = c.Account.SystemModstamp
                        },
                        Contact = new SfContact
                        {
                            Name = c.Contact.Name,
                            SystemModstamp = c.Contact.SystemModstamp
                        }
                    })
                    .FirstOrDefault();
srigaux commented 6 years ago

I forgot to credit https://github.com/dozer47528/LinqToSalesforce for the LinqProvider base code

srigaux commented 6 years ago

Would it be possible for you to release a pre-release version of the NuGet package? Or do you want me to publish my own.?

anthonyreilly commented 6 years ago

This will be a very interesting feature, so I am planning on it, but this PR has several breaking changes and conflicts that I need to rework first - it is modifying several files and introducing breaking changes in the core library besides just adding the new feature. I have not had time to do this yet, I should have some time later this week.

anthonyreilly commented 6 years ago

Merged and published as a pre-release package: https://www.nuget.org/packages/NetCoreForce.Linq/