예제 #1
0
        /// <inheritdoc />
        public async Task <HouseDto> ById(int id)
        {
            using (var db = new ApplicationDbContext())
            {
                var result = await db.Houses.FindAsync(id);

                if (result == null)
                {
                    throw new InternalExceptions.NotFoundException(id.ToString());
                }

                return(_mapper.ToDto(result));
            }
        }