Skip to content

ServiceNow.Core

SNow.Core

Table<T> Class

Handle ServiceNow tables API

csharp
public class Table<T> : SNow.Core.TableBase,
SNow.Core.ITable<T>
    where T : SNow.Core.Models.ServiceNowBaseModel

Type parameters

T

Inheritance System.Object 🡒 TableBase 🡒 Table<T>

Implements SNow.Core.ITable<T>

Constructors
Table(IServiceNow, ILogger)
Table(IServiceNow, string, ILogger)Used by typed and untyped Table
Fields
_where
Methods
AllToListAsync()Makes HTTP requests to get all data (from all pages)
AllToListAsync(CancellationToken)Makes HTTP requests to get all data (from all pages)
CreateAsync(object, CancellationToken)
DeleteAsync(Guid, CancellationToken)
GetByIdAsync(Guid, CancellationToken)
Limit(int)The maximum number of results returned per page (default: 10,000)
OrderBy(Expression<Func<T,object>>)
OrderByDesc(Expression<Func<T,object>>)
Select(Expression<Func<T,object>>[])List of properties to return, impacts the size of the response
SetHeaders(List<KeyValuePair<string,string>>)
ToListAsync(Nullable<int>)Makes the actual HTTP Request
ToListAsync(CancellationToken, Nullable<int>)Makes the actual HTTP Request
UpdateAsync(Nullable<Guid>, object, CancellationToken, bool)
Where(Expression<Func<T,bool>>)Set query parameters to the API request using Where clause.
Order matters so x => x.id == id works while x => id == x.id don't.
WithQuery(Expression<Func<T,string>>)The query must have only those operators and, or, like, =, !=, startsWith, endsWith see SN Rest Operators
Explicit Interface Implementations
SNow.Core.ITable<T>.CreateAsync(object)
SNow.Core.ITable<T>.DeleteAsync(Guid)
SNow.Core.ITable<T>.GetByIdAsync(Guid)
SNow.Core.ITable<T>.UpdateAsync(Nullable<Guid>, object, bool)

Released under the MIT License.