public async Task First() { LCQuery <LCObject> query = new LCQuery <LCObject>("Account"); LCObject account = await query.First(); Assert.NotNull(account.ObjectId); }
async Task <LCFriendshipRequest> GetRequest() { LCUser user = await LCUser.GetCurrent(); LCQuery <LCFriendshipRequest> query = new LCQuery <LCFriendshipRequest>("_FriendshipRequest") .WhereEqualTo("friend", user) .WhereEqualTo("status", "pending"); return(await query.First()); }
public async Task WhereObjectEquals() { LCQuery <LCObject> worldQuery = new LCQuery <LCObject>("World"); LCObject world = await worldQuery.Get("5e0d55ae21460d006a1ec931"); LCQuery <LCObject> helloQuery = new LCQuery <LCObject>("Hello"); helloQuery.WhereEqualTo("objectValue", world); LCObject hello = await helloQuery.First(); TestContext.WriteLine(hello.ObjectId); Assert.AreEqual(hello.ObjectId, "5e0d55aedd3c13006a53cd87"); }
public async Task WhereObjectEquals() { World world = new World(); Hello hello = new Hello { World = world }; await hello.Save(); LCQuery <LCObject> worldQuery = new LCQuery <LCObject>("World"); LCObject queryWorld = await worldQuery.Get(world.ObjectId); LCQuery <LCObject> helloQuery = new LCQuery <LCObject>("Hello"); helloQuery.WhereEqualTo("objectValue", queryWorld); LCObject queryHello = await helloQuery.First(); TestContext.WriteLine(queryHello.ObjectId); Assert.AreEqual(queryHello.ObjectId, hello.ObjectId); }