public ResponseResult EditShelterDetails(int shelterId, ShelterInfoModel model)
        {
            var shelter = _dbContext.Shelters.FirstOrDefault(s => s.Id == shelterId);

            if (shelter is null)
            {
                return(ResponseResult.Error("Does not exist"));
            }

            shelter.Name         = model.Name;
            shelter.City         = model.City;
            shelter.Address      = model.Address;
            shelter.Geolocation  = model.Geolocation;
            shelter.WebsiteUrl   = model.WebsiteUrl;
            shelter.ContactPhone = model.ContactPhone;
            shelter.ContactEmail = model.ContactEmail;
            shelter.Oib          = model.Oib;
            shelter.Iban         = model.Iban;

            var descriptionFilePath = @$ "ShelterDescription\{shelter.Id}.txt";
Exemple #2
0
        public ActionResult EditShelter(ShelterInfoModel model)
        {
            var result = _shelterRepository.EditShelterDetails(_shelterId, model);

            return(ResponseToActionResult(result));
        }