示例#1
0
        public IActionResult GetByFilter([FromBody] TimesheetObjDto timesheetObjDto)
        {
            var timesheetObj = _mapper.Map <TimesheetObj>(timesheetObjDto);
            var timesheet    = TimesheetFilter.GetFilteredTimesheet(timesheetObj);

            return(Ok(timesheet));
        }
        /// <summary>
        /// Asynchronously Retrieve Timesheets, with support for cancellation.
        /// </summary>
        /// <remarks>
        /// Retrieves a list of all timesheets associated with your company,
        /// with optional filters to narrow down the results.
        /// </remarks>
        /// <param name="filter">
        /// An instance of the <see cref="TimesheetFilter"/> class, for narrowing down the results.
        /// </param>
        /// <param name="options">
        /// An instance of the <see cref="RequestOptions"/> class, for customizing method processing.
        /// </param>
        /// <param name="cancellationToken">
        /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>
        /// An enumerable set of <see cref="Timesheet"/> objects, along with an output
        /// instance of the <see cref="ResultsMeta"/> class containing additional data.
        /// </returns>
        public async Task <(IList <Timesheet>, ResultsMeta)> GetTimesheetsAsync(
            TimesheetFilter filter,
            RequestOptions options,
            CancellationToken cancellationToken)
        {
            var context = new GetContext <Timesheet>(EndpointName.Timesheets, filter, options);

            await ExecuteOperationAsync(context, cancellationToken).ConfigureAwait(false);

            return(context.Results.Items, context.ResultsMeta);
        }
 /// <summary>
 /// Asynchronously Retrieve Timesheets.
 /// </summary>
 /// <remarks>
 /// Retrieves a list of all timesheets associated with your company,
 /// with optional filters to narrow down the results.
 /// </remarks>
 /// <param name="filter">
 /// An instance of the <see cref="TimesheetFilter"/> class, for narrowing down the results.
 /// </param>
 /// <param name="options">
 /// An instance of the <see cref="RequestOptions"/> class, for customizing method processing.
 /// </param>
 /// <returns>
 /// An enumerable set of <see cref="Timesheet"/> objects, along with an output
 /// instance of the <see cref="ResultsMeta"/> class containing additional data.
 /// </returns>
 public async Task <(IList <Timesheet>, ResultsMeta)> GetTimesheetsAsync(
     TimesheetFilter filter,
     RequestOptions options)
 {
     return(await GetTimesheetsAsync(filter, options, default).ConfigureAwait(false));
 }
 /// <summary>
 /// Asynchronously Retrieve Timesheets, with support for cancellation.
 /// </summary>
 /// <remarks>
 /// Retrieves a list of all timesheets associated with your company,
 /// with optional filters to narrow down the results.
 /// </remarks>
 /// <param name="filter">
 /// An instance of the <see cref="TimesheetFilter"/> class, for narrowing down the results.
 /// </param>
 /// <param name="cancellationToken">
 /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
 /// </param>
 /// <returns>
 /// An enumerable set of <see cref="Timesheet"/> objects, along with an output
 /// instance of the <see cref="ResultsMeta"/> class containing additional data.
 /// </returns>
 public async Task <(IList <Timesheet>, ResultsMeta)> GetTimesheetsAsync(
     TimesheetFilter filter,
     CancellationToken cancellationToken)
 {
     return(await GetTimesheetsAsync(filter, null, cancellationToken).ConfigureAwait(false));
 }
 /// <summary>
 /// Asynchronously Retrieve Timesheets.
 /// </summary>
 /// <remarks>
 /// Retrieves a list of all timesheets associated with your company,
 /// with optional filters to narrow down the results.
 /// </remarks>
 /// <param name="filter">
 /// An instance of the <see cref="TimesheetFilter"/> class, for narrowing down the results.
 /// </param>
 /// <returns>
 /// An enumerable set of <see cref="Timesheet"/> objects, along with an output
 /// instance of the <see cref="ResultsMeta"/> class containing additional data.
 /// </returns>
 public async Task <(IList <Timesheet>, ResultsMeta)> GetTimesheetsAsync(
     TimesheetFilter filter)
 {
     return(await GetTimesheetsAsync(filter, null, default).ConfigureAwait(false));
 }
 /// <summary>
 /// Retrieve Timesheets.
 /// </summary>
 /// <remarks>
 /// Retrieves a list of all timesheets associated with your company,
 /// with optional filters to narrow down the results.
 /// </remarks>
 /// <param name="filter">
 /// An instance of the <see cref="TimesheetFilter"/> class, for narrowing down the results.
 /// </param>
 /// <param name="options">
 /// An instance of the <see cref="RequestOptions"/> class, for customizing method processing.
 /// </param>
 /// <returns>
 /// An enumerable set of <see cref="Timesheet"/> objects, along with an output
 /// instance of the <see cref="ResultsMeta"/> class containing additional data.
 /// </returns>
 public (IList <Timesheet>, ResultsMeta) GetTimesheets(
     TimesheetFilter filter,
     RequestOptions options)
 {
     return(AsyncUtil.RunSync(() => GetTimesheetsAsync(filter, options)));
 }
 /// <summary>
 /// Retrieve Timesheets.
 /// </summary>
 /// <remarks>
 /// Retrieves a list of all timesheets associated with your company,
 /// with optional filters to narrow down the results.
 /// </remarks>
 /// <param name="filter">
 /// An instance of the <see cref="TimesheetFilter"/> class, for narrowing down the results.
 /// </param>
 /// <returns>
 /// An enumerable set of <see cref="Timesheet"/> objects, along with an output
 /// instance of the <see cref="ResultsMeta"/> class containing additional data.
 /// </returns>
 public (IList <Timesheet>, ResultsMeta) GetTimesheets(
     TimesheetFilter filter)
 {
     return(AsyncUtil.RunSync(() => GetTimesheetsAsync(filter)));
 }