예제 #1
0
        // GET: DataEntry/Details/5
        public async Task <IActionResult> Details(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var dataEntry = await _context.GetById(id);

            if (dataEntry == null)
            {
                return(NotFound());
            }

            return(View(dataEntry));
        }
예제 #2
0
        public async Task <IActionResult> Delete(string id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var dataEntry = await _dataentryRepository.GetById(id);

            if (dataEntry == null)
            {
                return(NotFound());
            }

            await _dataentryRepository.Delete(dataEntry);

            await _unitOfWork.CompleteAsync();

            return(Ok());
        }