示例#1
0
 public Task <Office> GetAsync(int id, IRequestContext context, CancellationToken cancellation)
 {
     try
     {
         return(Task.FromResult(_repository.Get(id).ToOfficeResource()));
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#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());
        }
示例#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));
        }
示例#4
0
 public object Get(DataSourceLoadOptions loadOptions)
 {
     return(DataSourceLoader.Load(_officeRepo.Get(), loadOptions));
 }
示例#5
0
        public async Task <Office> GetOffice(int id)
        {
            var entidad = await _officeRepository.Get(id);

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

            return(OfficeMapper.Map(office));
        }