Skip to content

Commit

Permalink
refactor de codigo
Browse files Browse the repository at this point in the history
  • Loading branch information
FABIO SILVA LIMA committed Jul 19, 2017
1 parent 0a06ca0 commit 348f6bb
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion FSL.Redemption.Mvc/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public HomeController(IProductService productService)

public ActionResult Index()
{
var allProducts = _productService.GetAllProducts();
var allProducts = _productService.GetAllProductsByStatus();

return View();
}
Expand Down
2 changes: 1 addition & 1 deletion FSL.Redemption.Mvc/Controllers/Old1Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public Old1Controller()
// GET: Old1
public ActionResult Index()
{
var allProducts = _productService.GetAllProducts();
var allProducts = _productService.GetAllProductsByStatus();

return View();
}
Expand Down
2 changes: 1 addition & 1 deletion FSL.Redemption.Mvc/Controllers/Old2Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public Old2Controller()
// GET: Old2
public ActionResult Index()
{
var allProducts = _productService.GetAllProducts();
var allProducts = _productService.GetAllProductsByStatus();

return View();
}
Expand Down
10 changes: 3 additions & 7 deletions FSL.Redemption.Mvc/Global.asax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@ protected void Application_Start()
private void RegisterContainer()
{
var container = new Container();

// 2. Configure the container (register)
// See below for more configuration examples

container.Register<IProductRepository, SqlProductRepository>(Lifestyle.Singleton);
container.Register<IProductService, ProductService>(Lifestyle.Singleton);

// 3. Optionally verify the container's configuration.

container.Verify();

// 4. Store the container for use by the application

DependencyResolver.SetResolver(
new SimpleInjectorDependencyResolver(container));

Expand Down
2 changes: 1 addition & 1 deletion FSL.Redemption.Mvc/Models/DI/IProductService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ namespace FSL.Redemption.Mvc.Models.DI
{
public interface IProductService
{
IList<string> GetAllProducts();
IList<string> GetAllProductsByStatus();
}
}
2 changes: 1 addition & 1 deletion FSL.Redemption.Mvc/Models/DI/ProductService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public ProductService(IProductRepository productRepository)
_productRepository = productRepository;
}

public IList<string> GetAllProducts()
public IList<string> GetAllProductsByStatus()
{
var criteria = "Status=1";

Expand Down
2 changes: 1 addition & 1 deletion FSL.Redemption.Mvc/Models/Old1/ProductService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public ProductService()
_productRepository = new SqlProductRepository();
}

public IList<string> GetAllProducts()
public IList<string> GetAllProductsByStatus()
{
var criteria = "Status=1";

Expand Down
2 changes: 1 addition & 1 deletion FSL.Redemption.Mvc/Models/Old2/ProductService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public ProductService(SqlProductRepository productRepository)
_productRepository = productRepository;
}

public IList<string> GetAllProducts()
public IList<string> GetAllProductsByStatus()
{
var criteria = "Status=1";

Expand Down

0 comments on commit 348f6bb

Please sign in to comment.