Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FluentQuery support (was V1ServiceFactory) #15

Open
GriffinNowak opened this issue Jun 12, 2015 · 9 comments
Open

FluentQuery support (was V1ServiceFactory) #15

GriffinNowak opened this issue Jun 12, 2015 · 9 comments

Comments

@GriffinNowak
Copy link

Fluent Queries are the best thing to ever hit this API. Thing is the service factory is using the depreciated V1APIConnector. I haven't found a way around it either. I'm trying.

@ghost
Copy link

ghost commented Jun 12, 2015

Glad you like the fluent interface!

We'll take a look from our side for the service factory issue.

@GriffinNowak
Copy link
Author

I was just about to email you. And yes it's very very very nice. I looked into replacing it but have run into quite a few problems. Namely the fact that it doesn't recognize the V1Connector. If you can figure it out I'd love to see it.

@GriffinNowak
Copy link
Author

Also, is there a way we could get a ASP.NET MVC example? That'd work wonders for me.

@ghost
Copy link

ghost commented Jun 12, 2015

Can you clarify what you mean by "V1ServiceFactory"? That currently isn't part of the .NET SDK that we can tell, but perhaps I am not understanding what you mean.

@GriffinNowak
Copy link
Author

VersionOne.SDK.NET.APIClient/Example/GettingStarted/src/
Examples is the only place I've seen fluent queries used.

@ghost
Copy link

ghost commented Jun 12, 2015

Ok, thanks.

That is an experimental approach that we have been working on, and not something that we are currently supporting.

But thanks for expressing interest!

@JogoShugh
Copy link
Contributor

Sorry it's been so long. I'm glad you liked the FluentQueries. We are picking up this work to get it to become official soon!

@GriffinNowak
Copy link
Author

I just interviewed for that internship again Tuesday! I don't think I'll be
doing the same thing but you certainly were a great help!

On Thu, Apr 28, 2016 at 1:35 PM Josh Gough notifications@github.com wrote:

Sorry it's been so long. I'm glad you liked the FluentQueries. We are
picking up this work to get it to become official soon!


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#15 (comment)

@JogoShugh
Copy link
Contributor

JogoShugh commented Apr 30, 2016

@GriffinNowak I know it might not be of interest anymore based on what you just said, but I just pushed a branch up that brings formal support of the FluentyQuery into the SDK. And, it's totally encsapsulated so there is absolutely no need to worry about the Services class or IMetaModel or anything of that nature.

Here's one of the example programs:

V1Connector
.WithInstanceUrl(BaseUrl)
.WithUserAgentHeader("Sample", "0.0.0")
.WithUsernameAndPassword(UserName, Password)
.Query("TeamRoom")
.Select("Team.Name", "Name")
.Success(assets => {
    foreach (Asset asset in assets)  {
        var team = asset["Team.Name"] + ":" + asset["Name"];
        Console.WriteLine(team);
    }
})
.Execute();

The next thing I'm planning to add is to enhance the Where method such that you'll be able to do things like: .Where(Equals("Name", "The value to match"), NotEquals("CreatedBy", "Somebody you want to exclude...")).

The free-standing Equals and NotEquals functions become possible in C# 6 because you can now import a static class into your scope!

@JogoShugh JogoShugh changed the title V1ServiceFactory FluentQuery support (was V1ServiceFactory) May 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants