public void Add(GeneralDonationViewModel viewModel) { _repository.Add(new GeneralDonation { CreationDate = DateTime.Now, IsItDeleted = false, Status = true, Name = viewModel.Name, Surname = viewModel.Surname, Email = viewModel.Email, City = viewModel.City, Adress = viewModel.Adress, PhoneNumber = viewModel.PhoneNumber, ZipCode = viewModel.ZipCode, Description = viewModel.Description, DonationAmount = viewModel.DonationAmount }); }
public void Update(GeneralDonationViewModel viewModel) // Gerek yok aslında { var generaldonates = _repository.Get(x => x.Id == viewModel.Id); generaldonates.Status = viewModel.Status; generaldonates.DateOfUpdate = DateTime.Now; generaldonates.IsItDeleted = viewModel.IsItDeleted; generaldonates.Name = viewModel.Name; generaldonates.Surname = viewModel.Surname; generaldonates.Email = viewModel.Email; generaldonates.City = viewModel.City; generaldonates.Adress = viewModel.Adress; generaldonates.PhoneNumber = viewModel.PhoneNumber; generaldonates.ZipCode = viewModel.ZipCode; generaldonates.Description = viewModel.Description; generaldonates.DonationAmount = viewModel.DonationAmount; _repository.Update(generaldonates); }