public ActionResult urunEkle(Product product, HttpPostedFileBase file) { if (file != null && file.ContentLength > 0) { var path = Path.Combine(Server.MapPath("~/img"), file.FileName); file.SaveAs(path); TempData["result"] = "Güncelleme Başarılı."; } IProductService productService = Business.IocUtil.Resolve <IProductService>(); string userName = Session["kullaniciAdi"].ToString(); product.PublishDate = DateTime.Now; product.ImagePath = Path.Combine(Server.MapPath("~/img"), file.FileName); IMapService mapService = IocUtil.Resolve <IMapService>(); mapService.FillAddress(product); bool added = productService.Add(userName, product); if (added) { return(Redirect("User/Index")); } else { return(View()); } }
public void MapServiceTest() { string latLong = ","; IMapService mapService = IocUtil.Resolve <IMapService>(); Product product = new Product(); product.LongLat = "41.008240,28.978359"; mapService.FillAddress(product); }