public IActionResult Create(HomeViewModel home) { //if (ModelState.IsValid) //{ if (home.Image != null) { var fileName = ImageHelpers.GetUniqueName(home.Image.FileName); home.HomeImg = fileName; var uploads = $"{@"C:\YeniEmlakImages\"}"; var filePath = Path.Combine(uploads, fileName); using (var fileStream = new FileStream(Path.Combine(uploads, fileName), FileMode.Create)) { home.Image.CopyTo(fileStream); } } homeRepo.Create(HomeViewModel.MapHomeViewModelToHome(home)); return(RedirectToAction("Index")); //} //else //{ // var errors = ModelState.Values.SelectMany(v => v.Errors); //} // return View("AddHome", home); }
public void Create(Home t) { //İş kurulları uygulanacak _homerepository.Create(t); }
public void Create(Home newHome) { _homeRepository.Create(newHome); }
private void CreateHome(long idClient, RequestClientDto requestClientDto) { requestClientDto.IdClient = idClient; _homeRepository.Create(_mapper.Map <HomeEntity>(requestClientDto)); }