Beispiel #1
0
 public Task <Office> GetAsync(int id, IRequestContext context, CancellationToken cancellation)
 {
     try
     {
         return(Task.FromResult(_repository.Get(id).ToOfficeResource()));
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #2
0
        public IActionResult Delete(int id)
        {
            var todelete = _repository.Get(id);

            if (todelete != null)
            {
                _repository.Delete(todelete);
                return(Helper.CheckResult(todelete, true));
            }
            return(NotFound());
        }
Beispiel #3
0
        public ModelResponse Get(long id)
        {
            OfficeVm r;

            try
            {
                r = Repo.Get(id);
                if (r == null)
                {
                    return(new ModelResponse(101));
                }
            }
            catch (Exception ex)
            {
                return(new ModelResponse(ex));
            }

            return(new ModelResponse(0, r));
        }
Beispiel #4
0
 public object Get(DataSourceLoadOptions loadOptions)
 {
     return(DataSourceLoader.Load(_officeRepo.Get(), loadOptions));
 }
Beispiel #5
0
        public async Task <Office> GetOffice(int id)
        {
            var entidad = await _officeRepository.Get(id);

            return(OfficeMapper.Map(entidad));
        }
Beispiel #6
0
        public async Task <Office> Get(int id)
        {
            var office = await _officeRepository.Get(id);

            return(OfficeMapper.Map(office));
        }