/// <summary> /// Gets the logbook items for station. /// </summary> /// <param name="callId">The call identifier.</param> /// <returns>LogbookItem[][].</returns> public LogbookItem[] GetLogbookItemsForStation(string callId) { var req = new WhereRequest { Field = "MyCallId", Value = callId }; return Provider<LogbookItem>.Where(req); }
/// <summary> /// Gets the children. /// </summary> /// <param name="root">The root.</param> /// <param name="hydrate">if set to <c>true</c> [hydrate].</param> /// <returns>Hook[].</returns> public Hook[] GetChildren(Hook root, bool hydrate = false) { var req = new WhereRequest() { Field = "ParentId", Value = root.Id }; var res = Provider <Hook> .Query(req); return(res != null?res.ToArray() : new Hook[] { }); }
/// <summary> /// Gets the description items for object. /// </summary> /// <param name="objectId">The object id.</param> /// <param name="displayName"></param> /// <returns>Description[][].</returns> public Description[] GetDescriptionsForObject(string objectId, string displayName) { var req = new WhereRequest() { Field = "ObjectId", Value = objectId }; var res = Provider <Description> .Where(req); if (res.Length == 0) { res = TaxonomyDomainGenerator.InflateDefaultDescriptions(objectId, displayName); } return(res); }
public void Try_GetUpholstryPages() { const bool save = false; const bool delete = false; try { if (save) { RegisterUpholstry(); } var req = new WhereRequest() { Descending = false, DocName = "OldDoc", ViewName = "OldView", Value = "Old", KeepView = false, EndId = null, EndKey = null, KeyField = "Id", Field = "DisplayName", IncludeDocs = true, Limit = 4, Reduce = false, Skip = 0, Stale = false, StartId = null, StartKey = "Upholstry04" }; var res = Provider <Upholstry> .Where(req); Console.WriteLine("Found {0} items", res.Length); foreach (var upholstry in res) { Console.WriteLine(upholstry.ToString()); } } finally { if (delete) { DeleteUpholstry(); } } }
public Hook GetHook(string id, string displayName, string ecoSpace) { var req = new WhereRequest() { KeyField = "Id", Field = "ObjectId", Value = id }; if (Provider <Hook> .Query(req).Any()) { return(Provider <Hook> .Query(req).First()); } var res = CreateEcoObject(id, displayName, ecoSpace); res = Provider <Hook> .Save(res); return(res); }
/// <summary> /// Gets the account for user. /// </summary> /// <param name="userName">Name of the user.</param> /// <returns>AccountItem.</returns> public Account GetAccountForUser(string userName) { Account acc = null; var req = new WhereRequest() { Field = "Username", Value = userName }; var res = Provider <Account> .Where(req); if (res.Any()) { acc = res.First(); } if (acc != null) { _logger.Info("Account for username:{0} \t id:{1} found!", acc.Username, acc.Id); } return(acc); }