This question is locked. New answers and comments are not allowed.
Hey there,
I am wondering how you recommend using the tool concerning structuring. I have 4 facets to my project...
1. Web - the website (ASP.NET MVC)
2. Test - test harness
3. Data - reverse-mapped Telerik ORM classes.
4. Services - interface between the Data and Web.
In theory I generate my Telerik classes in Data, then create access methods in my Service project that utilizes the Data classes, so the Web does not know how the objects are specifically persisted. I am finding that the service layer needs a level of config that is present in the Data project. For example, consider the method "AddCustomer(Customer c)"
The database name "DatabaseConnection1" is specified in a config file in the Data project. Is it fine to reference the object and fall-back to the Data project? Or should I keep the config in Services and inject it into the model objects in Data? The tool seems to want to keep both together, but I'd really like to seperate Data from Services if at all possible.
Thx,
Rob
I am wondering how you recommend using the tool concerning structuring. I have 4 facets to my project...
1. Web - the website (ASP.NET MVC)
2. Test - test harness
3. Data - reverse-mapped Telerik ORM classes.
4. Services - interface between the Data and Web.
In theory I generate my Telerik classes in Data, then create access methods in my Service project that utilizes the Data classes, so the Web does not know how the objects are specifically persisted. I am finding that the service layer needs a level of config that is present in the Data project. For example, consider the method "AddCustomer(Customer c)"
public void AddCustomer(Customer c) {//pseudo code... do NOT assume to be 100% valid. |
IObjectScope scope = Database.Get("DatabaseConnection1").GetNewObjectScope(); |
//you could see in some expamples that this can also be done with |
//Database.Get("DatabaseConnection1").GetObjectScope(); |
//there is absolutely no diference |
using (scope) |
{ |
scope.Transaction.Begin(); |
Customer c = new SharedEvent.Data.Model.Customer(); |
c.FName = "Joe"; |
c.LName = "Test"; |
c.PassEncrypted = "testpass"; |
scope.Add(c); |
scope.Transaction.Commit(); |
} |
} |
The database name "DatabaseConnection1" is specified in a config file in the Data project. Is it fine to reference the object and fall-back to the Data project? Or should I keep the config in Services and inject it into the model objects in Data? The tool seems to want to keep both together, but I'd really like to seperate Data from Services if at all possible.
Thx,
Rob