Project Structuring Service Layer and Data layer , Domain & Separation c#












-2












$begingroup$


My Project is structured as follows
All in blue circles are class library
enter image description here



Project Domain
Project domain contains POCO class as well as their relationship .in our case we have Product and ProductCategory



using System;
using System.Collections.Generic;
using System.Text;

namespace DOMAIN
{
public class Product
{
public int ProductID { get; set; }
public int ProductCategoryID { get; set; }
public string ProductName { get; set; }

public ProductCategory ProductCategory { get; set; }
}
}


And Product Category



using System;
using System.Collections.Generic;
using System.Text;

namespace DOMAIN
{
public class ProductCategory
{
public int ProductCategoryID { get; set; }
public string Name { get; set; }

List<Product> Products { get; set; }
}
}


2 : Repository Has Repository for each Table in our case Product will have ProductRepository and ProductCategory will have ProductCategoryRepository



BaseRepository will contain wrapper methods for db access in our case l am using Dapper



Product Repository example :



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
using DOMAIN;

namespace REPOSITORY
{
public class ProductRepository : BaseRepository
{
public List<Product> GetListProduct()
{
using (var db = CreateConnection())
{
return db.Query<Product, ProductCategory, Product>(@"SELECT TOP (1000) pro.* , proCat.*
FROM[DbDapper].[dbo].[Product] As pro
inner join ProductCategory As proCat on pro.ProductCategoryID = proCat.ProductCategoryID" ,
(p, c) => { p.ProductCategory = c; return p; }
, splitOn: "ProductCategoryID")
.AsList();
}
}
public Product GetProduct(int productID)
{
using (var db = CreateConnection())
{
var sql = @"SELECT TOP 1 pro.* , proCat.*
FROM[DbDapper].[dbo].[Product] As pro
inner join ProductCategory As proCat on pro.ProductCategoryID = proCat.ProductCategoryID
where pro.ProductID = @productID ";
return db.Query<Product , ProductCategory , Product>(sql ,
(p, c) => { p.ProductCategory = c; return p; },
new { productID = productID }
, splitOn: "ProductCategoryID")
.FirstOrDefault();

}
}
}
}


the Unit of Work Repository UnitofWorkRepository.cs will have all the repository its sort of a manager for all the repository as shown below



using System;
using System.Collections.Generic;
using System.Text;

namespace REPOSITORY
{
public class UnitOfWorkRepository
{
private ProductRepository _productRepository { get; set; }
private ProductCategoryRepository _productCategoryRepository { get; set; }

public UnitOfWorkRepository()
{
Initialize();
}

private void Initialize()
{
_productCategoryRepository = _productCategoryRepository ?? new ProductCategoryRepository();
_productRepository = _productRepository ?? new ProductRepository();
}

public ProductCategoryRepository ProductCategoryRepository { get { return this._productCategoryRepository; } }
public ProductRepository ProductRepository { get { return this._productRepository; } }
}
}


The Service layer will have its service but however it will have 2 constructor properties which are the object of the current user logged in the system and an instance of the Repository. the user object will be passed like if it is asp mvc l will pass the object of the Logged to the service layer as well as if am on an api will have a session of the logged user as an object in our case UserSession under project > Domain > Session .



l also do my validation in the service layer



sample of product service layer



    using DOMAIN;
using DOMAIN.Session;
using REPOSITORY;
using System;
using System.Collections.Generic;
using System.Text;

namespace SERVICE
{
public class ProductService
{
private UserSession _userSession;
private UnitOfWorkRepository _dbRepository;

public ProductService(UserSession userSession , UnitOfWorkRepository dbRepository)
{
_userSession = userSession;
_dbRepository = dbRepository;
}

public List<Product> GetListProducts()
{
return _dbRepository.ProductRepository.GetListProduct();
}

public Product GetProduct(int productID)
{
return _dbRepository.ProductRepository.GetProduct(productID);
}


public void SaveProduct(Product product)
{

if( _userSession.roleID != 1)
{
// user is not priviledged to add
return ;
}
// continue saving
//
}
}
}


like when saving method l have to check user priviledges etc.



l need review on the Following :



DOMAIN
1: Is it right to have the sessions domain there or am total wrong something else must be done .



REPOSITORY
2: Having all the class repository in one class UnitOfWork saves me time when l what to check something form another repository in a service layer rather than passing many constructors in a repository for example l simple do



_dbRepository.<RepositoryName>.<MethodName>.<Parameter>

//for example
_dbRepository.ProductRepository.GetListProduct();


rather than doing something like



  ProductService (UserSession userSession , ProductRepository productRepository , ProductCategoryRepository , N++ Repository)


Service
3: On the Serivces
is it right to pass the logged user object



4: is it also ok to have all the service in one class like l did for repository is there an perfomance issues , something like



_allService.<serviceNme>.<serviceMethod><paramter>


Edit 2:
My asp mvc project will look like below :



using REPOSITORY;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DOMAIN.Session;
using SERVICE;


namespace WEB.Controllers
{
public class ProductController : Controller
{
UserSession _user ;

// this is out db repositories
UnitOfWorkRepository _unitOfWork;

// this is out service
ProductService _productService;


public ProductController()
{
_user = (UserSession)System.Web.HttpContext.Current.Session["loggedUser"];
_unitOfWork = new UnitOfWorkRepository();
_productService = new ProductService(_user, _unitOfWork);
}
// GET: Product
public ActionResult Index()
{
var productList = _productService.GetListProducts();

return View(productList);
}
}
}


Edit 3 : i have updated image including the web of how l reference the service layer .










share|improve this question









New contributor




Billy Watsy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$












  • $begingroup$
    why the down vote l have tried to add more details you could have asked to add more information if l have missed anything on the question , this is suppose to be code review so as to improve my code , ain't fare to just down vote the question . if the code or structure is wrong then thus the purpose of code review
    $endgroup$
    – Billy Watsy
    14 hours ago












  • $begingroup$
    You need to post your real and complete code. This looks like there's a lot of code missing here.
    $endgroup$
    – t3chb0t
    12 hours ago










  • $begingroup$
    @t3chb0t let me try to add more code ,
    $endgroup$
    – Billy Watsy
    12 hours ago
















-2












$begingroup$


My Project is structured as follows
All in blue circles are class library
enter image description here



Project Domain
Project domain contains POCO class as well as their relationship .in our case we have Product and ProductCategory



using System;
using System.Collections.Generic;
using System.Text;

namespace DOMAIN
{
public class Product
{
public int ProductID { get; set; }
public int ProductCategoryID { get; set; }
public string ProductName { get; set; }

public ProductCategory ProductCategory { get; set; }
}
}


And Product Category



using System;
using System.Collections.Generic;
using System.Text;

namespace DOMAIN
{
public class ProductCategory
{
public int ProductCategoryID { get; set; }
public string Name { get; set; }

List<Product> Products { get; set; }
}
}


2 : Repository Has Repository for each Table in our case Product will have ProductRepository and ProductCategory will have ProductCategoryRepository



BaseRepository will contain wrapper methods for db access in our case l am using Dapper



Product Repository example :



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
using DOMAIN;

namespace REPOSITORY
{
public class ProductRepository : BaseRepository
{
public List<Product> GetListProduct()
{
using (var db = CreateConnection())
{
return db.Query<Product, ProductCategory, Product>(@"SELECT TOP (1000) pro.* , proCat.*
FROM[DbDapper].[dbo].[Product] As pro
inner join ProductCategory As proCat on pro.ProductCategoryID = proCat.ProductCategoryID" ,
(p, c) => { p.ProductCategory = c; return p; }
, splitOn: "ProductCategoryID")
.AsList();
}
}
public Product GetProduct(int productID)
{
using (var db = CreateConnection())
{
var sql = @"SELECT TOP 1 pro.* , proCat.*
FROM[DbDapper].[dbo].[Product] As pro
inner join ProductCategory As proCat on pro.ProductCategoryID = proCat.ProductCategoryID
where pro.ProductID = @productID ";
return db.Query<Product , ProductCategory , Product>(sql ,
(p, c) => { p.ProductCategory = c; return p; },
new { productID = productID }
, splitOn: "ProductCategoryID")
.FirstOrDefault();

}
}
}
}


the Unit of Work Repository UnitofWorkRepository.cs will have all the repository its sort of a manager for all the repository as shown below



using System;
using System.Collections.Generic;
using System.Text;

namespace REPOSITORY
{
public class UnitOfWorkRepository
{
private ProductRepository _productRepository { get; set; }
private ProductCategoryRepository _productCategoryRepository { get; set; }

public UnitOfWorkRepository()
{
Initialize();
}

private void Initialize()
{
_productCategoryRepository = _productCategoryRepository ?? new ProductCategoryRepository();
_productRepository = _productRepository ?? new ProductRepository();
}

public ProductCategoryRepository ProductCategoryRepository { get { return this._productCategoryRepository; } }
public ProductRepository ProductRepository { get { return this._productRepository; } }
}
}


The Service layer will have its service but however it will have 2 constructor properties which are the object of the current user logged in the system and an instance of the Repository. the user object will be passed like if it is asp mvc l will pass the object of the Logged to the service layer as well as if am on an api will have a session of the logged user as an object in our case UserSession under project > Domain > Session .



l also do my validation in the service layer



sample of product service layer



    using DOMAIN;
using DOMAIN.Session;
using REPOSITORY;
using System;
using System.Collections.Generic;
using System.Text;

namespace SERVICE
{
public class ProductService
{
private UserSession _userSession;
private UnitOfWorkRepository _dbRepository;

public ProductService(UserSession userSession , UnitOfWorkRepository dbRepository)
{
_userSession = userSession;
_dbRepository = dbRepository;
}

public List<Product> GetListProducts()
{
return _dbRepository.ProductRepository.GetListProduct();
}

public Product GetProduct(int productID)
{
return _dbRepository.ProductRepository.GetProduct(productID);
}


public void SaveProduct(Product product)
{

if( _userSession.roleID != 1)
{
// user is not priviledged to add
return ;
}
// continue saving
//
}
}
}


like when saving method l have to check user priviledges etc.



l need review on the Following :



DOMAIN
1: Is it right to have the sessions domain there or am total wrong something else must be done .



REPOSITORY
2: Having all the class repository in one class UnitOfWork saves me time when l what to check something form another repository in a service layer rather than passing many constructors in a repository for example l simple do



_dbRepository.<RepositoryName>.<MethodName>.<Parameter>

//for example
_dbRepository.ProductRepository.GetListProduct();


rather than doing something like



  ProductService (UserSession userSession , ProductRepository productRepository , ProductCategoryRepository , N++ Repository)


Service
3: On the Serivces
is it right to pass the logged user object



4: is it also ok to have all the service in one class like l did for repository is there an perfomance issues , something like



_allService.<serviceNme>.<serviceMethod><paramter>


Edit 2:
My asp mvc project will look like below :



using REPOSITORY;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DOMAIN.Session;
using SERVICE;


namespace WEB.Controllers
{
public class ProductController : Controller
{
UserSession _user ;

// this is out db repositories
UnitOfWorkRepository _unitOfWork;

// this is out service
ProductService _productService;


public ProductController()
{
_user = (UserSession)System.Web.HttpContext.Current.Session["loggedUser"];
_unitOfWork = new UnitOfWorkRepository();
_productService = new ProductService(_user, _unitOfWork);
}
// GET: Product
public ActionResult Index()
{
var productList = _productService.GetListProducts();

return View(productList);
}
}
}


Edit 3 : i have updated image including the web of how l reference the service layer .










share|improve this question









New contributor




Billy Watsy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$












  • $begingroup$
    why the down vote l have tried to add more details you could have asked to add more information if l have missed anything on the question , this is suppose to be code review so as to improve my code , ain't fare to just down vote the question . if the code or structure is wrong then thus the purpose of code review
    $endgroup$
    – Billy Watsy
    14 hours ago












  • $begingroup$
    You need to post your real and complete code. This looks like there's a lot of code missing here.
    $endgroup$
    – t3chb0t
    12 hours ago










  • $begingroup$
    @t3chb0t let me try to add more code ,
    $endgroup$
    – Billy Watsy
    12 hours ago














-2












-2








-2





$begingroup$


My Project is structured as follows
All in blue circles are class library
enter image description here



Project Domain
Project domain contains POCO class as well as their relationship .in our case we have Product and ProductCategory



using System;
using System.Collections.Generic;
using System.Text;

namespace DOMAIN
{
public class Product
{
public int ProductID { get; set; }
public int ProductCategoryID { get; set; }
public string ProductName { get; set; }

public ProductCategory ProductCategory { get; set; }
}
}


And Product Category



using System;
using System.Collections.Generic;
using System.Text;

namespace DOMAIN
{
public class ProductCategory
{
public int ProductCategoryID { get; set; }
public string Name { get; set; }

List<Product> Products { get; set; }
}
}


2 : Repository Has Repository for each Table in our case Product will have ProductRepository and ProductCategory will have ProductCategoryRepository



BaseRepository will contain wrapper methods for db access in our case l am using Dapper



Product Repository example :



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
using DOMAIN;

namespace REPOSITORY
{
public class ProductRepository : BaseRepository
{
public List<Product> GetListProduct()
{
using (var db = CreateConnection())
{
return db.Query<Product, ProductCategory, Product>(@"SELECT TOP (1000) pro.* , proCat.*
FROM[DbDapper].[dbo].[Product] As pro
inner join ProductCategory As proCat on pro.ProductCategoryID = proCat.ProductCategoryID" ,
(p, c) => { p.ProductCategory = c; return p; }
, splitOn: "ProductCategoryID")
.AsList();
}
}
public Product GetProduct(int productID)
{
using (var db = CreateConnection())
{
var sql = @"SELECT TOP 1 pro.* , proCat.*
FROM[DbDapper].[dbo].[Product] As pro
inner join ProductCategory As proCat on pro.ProductCategoryID = proCat.ProductCategoryID
where pro.ProductID = @productID ";
return db.Query<Product , ProductCategory , Product>(sql ,
(p, c) => { p.ProductCategory = c; return p; },
new { productID = productID }
, splitOn: "ProductCategoryID")
.FirstOrDefault();

}
}
}
}


the Unit of Work Repository UnitofWorkRepository.cs will have all the repository its sort of a manager for all the repository as shown below



using System;
using System.Collections.Generic;
using System.Text;

namespace REPOSITORY
{
public class UnitOfWorkRepository
{
private ProductRepository _productRepository { get; set; }
private ProductCategoryRepository _productCategoryRepository { get; set; }

public UnitOfWorkRepository()
{
Initialize();
}

private void Initialize()
{
_productCategoryRepository = _productCategoryRepository ?? new ProductCategoryRepository();
_productRepository = _productRepository ?? new ProductRepository();
}

public ProductCategoryRepository ProductCategoryRepository { get { return this._productCategoryRepository; } }
public ProductRepository ProductRepository { get { return this._productRepository; } }
}
}


The Service layer will have its service but however it will have 2 constructor properties which are the object of the current user logged in the system and an instance of the Repository. the user object will be passed like if it is asp mvc l will pass the object of the Logged to the service layer as well as if am on an api will have a session of the logged user as an object in our case UserSession under project > Domain > Session .



l also do my validation in the service layer



sample of product service layer



    using DOMAIN;
using DOMAIN.Session;
using REPOSITORY;
using System;
using System.Collections.Generic;
using System.Text;

namespace SERVICE
{
public class ProductService
{
private UserSession _userSession;
private UnitOfWorkRepository _dbRepository;

public ProductService(UserSession userSession , UnitOfWorkRepository dbRepository)
{
_userSession = userSession;
_dbRepository = dbRepository;
}

public List<Product> GetListProducts()
{
return _dbRepository.ProductRepository.GetListProduct();
}

public Product GetProduct(int productID)
{
return _dbRepository.ProductRepository.GetProduct(productID);
}


public void SaveProduct(Product product)
{

if( _userSession.roleID != 1)
{
// user is not priviledged to add
return ;
}
// continue saving
//
}
}
}


like when saving method l have to check user priviledges etc.



l need review on the Following :



DOMAIN
1: Is it right to have the sessions domain there or am total wrong something else must be done .



REPOSITORY
2: Having all the class repository in one class UnitOfWork saves me time when l what to check something form another repository in a service layer rather than passing many constructors in a repository for example l simple do



_dbRepository.<RepositoryName>.<MethodName>.<Parameter>

//for example
_dbRepository.ProductRepository.GetListProduct();


rather than doing something like



  ProductService (UserSession userSession , ProductRepository productRepository , ProductCategoryRepository , N++ Repository)


Service
3: On the Serivces
is it right to pass the logged user object



4: is it also ok to have all the service in one class like l did for repository is there an perfomance issues , something like



_allService.<serviceNme>.<serviceMethod><paramter>


Edit 2:
My asp mvc project will look like below :



using REPOSITORY;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DOMAIN.Session;
using SERVICE;


namespace WEB.Controllers
{
public class ProductController : Controller
{
UserSession _user ;

// this is out db repositories
UnitOfWorkRepository _unitOfWork;

// this is out service
ProductService _productService;


public ProductController()
{
_user = (UserSession)System.Web.HttpContext.Current.Session["loggedUser"];
_unitOfWork = new UnitOfWorkRepository();
_productService = new ProductService(_user, _unitOfWork);
}
// GET: Product
public ActionResult Index()
{
var productList = _productService.GetListProducts();

return View(productList);
}
}
}


Edit 3 : i have updated image including the web of how l reference the service layer .










share|improve this question









New contributor




Billy Watsy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




My Project is structured as follows
All in blue circles are class library
enter image description here



Project Domain
Project domain contains POCO class as well as their relationship .in our case we have Product and ProductCategory



using System;
using System.Collections.Generic;
using System.Text;

namespace DOMAIN
{
public class Product
{
public int ProductID { get; set; }
public int ProductCategoryID { get; set; }
public string ProductName { get; set; }

public ProductCategory ProductCategory { get; set; }
}
}


And Product Category



using System;
using System.Collections.Generic;
using System.Text;

namespace DOMAIN
{
public class ProductCategory
{
public int ProductCategoryID { get; set; }
public string Name { get; set; }

List<Product> Products { get; set; }
}
}


2 : Repository Has Repository for each Table in our case Product will have ProductRepository and ProductCategory will have ProductCategoryRepository



BaseRepository will contain wrapper methods for db access in our case l am using Dapper



Product Repository example :



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
using DOMAIN;

namespace REPOSITORY
{
public class ProductRepository : BaseRepository
{
public List<Product> GetListProduct()
{
using (var db = CreateConnection())
{
return db.Query<Product, ProductCategory, Product>(@"SELECT TOP (1000) pro.* , proCat.*
FROM[DbDapper].[dbo].[Product] As pro
inner join ProductCategory As proCat on pro.ProductCategoryID = proCat.ProductCategoryID" ,
(p, c) => { p.ProductCategory = c; return p; }
, splitOn: "ProductCategoryID")
.AsList();
}
}
public Product GetProduct(int productID)
{
using (var db = CreateConnection())
{
var sql = @"SELECT TOP 1 pro.* , proCat.*
FROM[DbDapper].[dbo].[Product] As pro
inner join ProductCategory As proCat on pro.ProductCategoryID = proCat.ProductCategoryID
where pro.ProductID = @productID ";
return db.Query<Product , ProductCategory , Product>(sql ,
(p, c) => { p.ProductCategory = c; return p; },
new { productID = productID }
, splitOn: "ProductCategoryID")
.FirstOrDefault();

}
}
}
}


the Unit of Work Repository UnitofWorkRepository.cs will have all the repository its sort of a manager for all the repository as shown below



using System;
using System.Collections.Generic;
using System.Text;

namespace REPOSITORY
{
public class UnitOfWorkRepository
{
private ProductRepository _productRepository { get; set; }
private ProductCategoryRepository _productCategoryRepository { get; set; }

public UnitOfWorkRepository()
{
Initialize();
}

private void Initialize()
{
_productCategoryRepository = _productCategoryRepository ?? new ProductCategoryRepository();
_productRepository = _productRepository ?? new ProductRepository();
}

public ProductCategoryRepository ProductCategoryRepository { get { return this._productCategoryRepository; } }
public ProductRepository ProductRepository { get { return this._productRepository; } }
}
}


The Service layer will have its service but however it will have 2 constructor properties which are the object of the current user logged in the system and an instance of the Repository. the user object will be passed like if it is asp mvc l will pass the object of the Logged to the service layer as well as if am on an api will have a session of the logged user as an object in our case UserSession under project > Domain > Session .



l also do my validation in the service layer



sample of product service layer



    using DOMAIN;
using DOMAIN.Session;
using REPOSITORY;
using System;
using System.Collections.Generic;
using System.Text;

namespace SERVICE
{
public class ProductService
{
private UserSession _userSession;
private UnitOfWorkRepository _dbRepository;

public ProductService(UserSession userSession , UnitOfWorkRepository dbRepository)
{
_userSession = userSession;
_dbRepository = dbRepository;
}

public List<Product> GetListProducts()
{
return _dbRepository.ProductRepository.GetListProduct();
}

public Product GetProduct(int productID)
{
return _dbRepository.ProductRepository.GetProduct(productID);
}


public void SaveProduct(Product product)
{

if( _userSession.roleID != 1)
{
// user is not priviledged to add
return ;
}
// continue saving
//
}
}
}


like when saving method l have to check user priviledges etc.



l need review on the Following :



DOMAIN
1: Is it right to have the sessions domain there or am total wrong something else must be done .



REPOSITORY
2: Having all the class repository in one class UnitOfWork saves me time when l what to check something form another repository in a service layer rather than passing many constructors in a repository for example l simple do



_dbRepository.<RepositoryName>.<MethodName>.<Parameter>

//for example
_dbRepository.ProductRepository.GetListProduct();


rather than doing something like



  ProductService (UserSession userSession , ProductRepository productRepository , ProductCategoryRepository , N++ Repository)


Service
3: On the Serivces
is it right to pass the logged user object



4: is it also ok to have all the service in one class like l did for repository is there an perfomance issues , something like



_allService.<serviceNme>.<serviceMethod><paramter>


Edit 2:
My asp mvc project will look like below :



using REPOSITORY;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DOMAIN.Session;
using SERVICE;


namespace WEB.Controllers
{
public class ProductController : Controller
{
UserSession _user ;

// this is out db repositories
UnitOfWorkRepository _unitOfWork;

// this is out service
ProductService _productService;


public ProductController()
{
_user = (UserSession)System.Web.HttpContext.Current.Session["loggedUser"];
_unitOfWork = new UnitOfWorkRepository();
_productService = new ProductService(_user, _unitOfWork);
}
// GET: Product
public ActionResult Index()
{
var productList = _productService.GetListProducts();

return View(productList);
}
}
}


Edit 3 : i have updated image including the web of how l reference the service layer .







c#






share|improve this question









New contributor




Billy Watsy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Billy Watsy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 12 hours ago







Billy Watsy













New contributor




Billy Watsy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 15 hours ago









Billy WatsyBilly Watsy

41




41




New contributor




Billy Watsy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Billy Watsy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Billy Watsy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • $begingroup$
    why the down vote l have tried to add more details you could have asked to add more information if l have missed anything on the question , this is suppose to be code review so as to improve my code , ain't fare to just down vote the question . if the code or structure is wrong then thus the purpose of code review
    $endgroup$
    – Billy Watsy
    14 hours ago












  • $begingroup$
    You need to post your real and complete code. This looks like there's a lot of code missing here.
    $endgroup$
    – t3chb0t
    12 hours ago










  • $begingroup$
    @t3chb0t let me try to add more code ,
    $endgroup$
    – Billy Watsy
    12 hours ago


















  • $begingroup$
    why the down vote l have tried to add more details you could have asked to add more information if l have missed anything on the question , this is suppose to be code review so as to improve my code , ain't fare to just down vote the question . if the code or structure is wrong then thus the purpose of code review
    $endgroup$
    – Billy Watsy
    14 hours ago












  • $begingroup$
    You need to post your real and complete code. This looks like there's a lot of code missing here.
    $endgroup$
    – t3chb0t
    12 hours ago










  • $begingroup$
    @t3chb0t let me try to add more code ,
    $endgroup$
    – Billy Watsy
    12 hours ago
















$begingroup$
why the down vote l have tried to add more details you could have asked to add more information if l have missed anything on the question , this is suppose to be code review so as to improve my code , ain't fare to just down vote the question . if the code or structure is wrong then thus the purpose of code review
$endgroup$
– Billy Watsy
14 hours ago






$begingroup$
why the down vote l have tried to add more details you could have asked to add more information if l have missed anything on the question , this is suppose to be code review so as to improve my code , ain't fare to just down vote the question . if the code or structure is wrong then thus the purpose of code review
$endgroup$
– Billy Watsy
14 hours ago














$begingroup$
You need to post your real and complete code. This looks like there's a lot of code missing here.
$endgroup$
– t3chb0t
12 hours ago




$begingroup$
You need to post your real and complete code. This looks like there's a lot of code missing here.
$endgroup$
– t3chb0t
12 hours ago












$begingroup$
@t3chb0t let me try to add more code ,
$endgroup$
– Billy Watsy
12 hours ago




$begingroup$
@t3chb0t let me try to add more code ,
$endgroup$
– Billy Watsy
12 hours ago










0






active

oldest

votes











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
});
});
}, "mathjax-editing");

StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "196"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Billy Watsy is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f211612%2fproject-structuring-service-layer-and-data-layer-domain-separation-c%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








Billy Watsy is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Billy Watsy is a new contributor. Be nice, and check out our Code of Conduct.













Billy Watsy is a new contributor. Be nice, and check out our Code of Conduct.












Billy Watsy is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Code Review Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f211612%2fproject-structuring-service-layer-and-data-layer-domain-separation-c%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Terni

A new problem with tex4ht and tikz

Sun Ra