Beispiel #1
0
        public async Task <ApiResponse> Put(long id, [FromBody] QueueTypeRequest request)
        {
            if (!ModelState.IsValid)
            {
                throw new ApiException(ModelState.AllErrors());
            }
            var result = await _queueTypeManager.UpdateAsync(request, id).ConfigureAwait(false);

            return(new ApiResponse("Record successfully updated.", result, Status201Created));
        }
 public async Task <QueueType> UpdateAsync(QueueTypeRequest entity, object id)
 {
     return(await DbQuerySingleAsync <QueueType>("[dbo].[usp_QueueTypeUpdate]", new
     {
         entity.UserName,
         entity.QueueTypeName,
         entity.QueueTypeDescription,
         Id = id
     }).ConfigureAwait(false));
 }
Beispiel #3
0
        public async Task <ApiResponse> Post([FromBody] QueueTypeRequest request)
        {
            if (!ModelState.IsValid)
            {
                throw new ApiProblemDetailsException(ModelState);
            }
            var result = await _queueTypeManager.CreateAsync(request).ConfigureAwait(false);

            return(new ApiResponse("Record successfully created.", result, Status201Created));
        }
 public async Task <QueueType> CreateAsync(QueueTypeRequest entity)
 {
     return(await DbQuerySingleAsync <QueueType>("[dbo].[usp_QueueTypeInsert]", entity).ConfigureAwait(false));
 }