I would like to incorporate SOA pattern in my 3 tier structure. I created a Service layer (WCF Host) between the BLL and the UI. My structure setup is now looks like this
UI <> WCF <> BLL <> DAL
<---[Entities] --->
The problem is, I have my entities in separate DLL (ANd it was visible in ALL Layers except on the UI) Now, I need to expose it so that the consumer of my service can use it.In this case, the UI. How can I possibly do that?
Entities.DLL
namespace Entities
{
public class Account
{
public string AcctID { get; set; }
public string AcctName { get; set; }
}
}
now, Im planning to use it in WCF
Service Interface Layer
public class AccountService : IAccountService
{
public Account GetAccount(string AcctID)
{
//fetch from DAL through BLL
}
}
Is it ok to just Attribute my Entities? (Note, I'm also using the entities in DAL and BLL)
using System.Runtime.Serialization;
namespace Entities
{
[DataContract]
public class Account
{
[DataMember]
public string AcctID { get; set; }
[DataMember]
public string AcctName { get; set; }
}
}
Any suggestion guys?