public async Task <FoodResponseObject> FindOneByIdAsync(int id)
        {
            var found = await _foodRepository.FindOneByIdAsync(id);

            if (found == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound, "Food not found");
            }

            return(FoodResponseObject.FromEntity(found));
        }
        public async Task <PublicationResponseObject> CreateOneAsync(CreatePublicationDto t)
        {
            // Validando que exista el usuario
            var foundUser = await _usersRepository.FindOneByIdAsync(t.UserId);

            if (foundUser == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound, "User not found");
            }


            // Validando que exista Food
            var foundFood = await _foodRepository.FindOneByIdAsync(t.FoodId);

            if (foundFood == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound, "Food not found");
            }


            // Validando que exista la publicacion no exista
            var found = await _publicationsRepository.FindOneByUserIdAndFoodIdAndDescriptionAsync(t.UserId, t.FoodId, t.Description);

            if (found != null)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest, "Publication already exists");
            }


            // Validaciones
            if (!IsDescriptionValid(t.Description))
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest, "Description is not valid");
            }

            if (!IsStockValid(t.Stock))
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest, "Stock is invalid");
            }

            if (!IsPricePerUnitValid(t.PricePerUnit))
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest, "PricePerUnit is invalid");
            }

            // if (!AreDatesValid(t.StartDate, t.EndDate))
            // throw new HttpResponseException(HttpStatusCode.BadRequest, "Dates are invalid");

            if (!IsImageUrlValid(t.ImageUrl))
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest, "ImageUrl is invalid");
            }


            // Creation
            var newPublication = new Publication()
            {
                Description = t.Description,
                Stock       = t.Stock,
                StartDate   = t.StartDate,
                // EndDate = t.EndDate,
                ImageUrl     = t.ImageUrl,
                IsPublished  = t.IsPublished,
                PricePerUnit = t.PricePerUnit,
                FoodId       = foundFood.Id,
                UserId       = foundUser.Id,
                CreatedAt    = DateTime.Now,
                UpdatedAt    = DateTime.Now
            };

            await _publicationsRepository.CreateOneAsync(newPublication);

            var entity = await _publicationsRepository.FindOneByIdAsync(newPublication.Id);

            return(PublicationResponseObject.FromEntity(entity));
        }