public static async Task <List <Employee> > GetEmployeesAsync(AuthInfo authInfo) { using (NimbleApiInterface apiInterface = new NimbleApiInterface(authInfo)) { return(await apiInterface.GetEmployeesAsync()); } }
public static async Task <List <Shift> > GetShiftsAsync(DateTime startDate, DateTime endDate, AuthInfo authInfo) { using (NimbleApiInterface apiInterface = new NimbleApiInterface(authInfo)) { return(await apiInterface.GetShiftsAsync(startDate, endDate)); } }
/// <summary> /// Asynchronous method to the nimbleschedule api to get all locations that the user has access to. /// </summary> /// <param name="authInfo">The authentication object with api credentials.</param> /// <returns>.NET List Collection of location objects for the company.</returns> public static async Task <List <Location> > GetAccessibleLocationsAsync(AuthInfo authInfo) { // call interrface within using so that dispose gets called on resources using (NimbleApiInterface apiInterface = new NimbleApiInterface(authInfo)) { return(await apiInterface.GetAccessibleLocationsAsync()); } }