I am having trouble understanding how to use the generated ORM objects. We use LLBLGen to map our database model to objects. We encapsulate these objects in another layer, which represents our business model (I think).
Perhaps this bit of code will explain this better.
public class Book {
private BookEntity book;
private BookType bookType;
public Book(int Id) {
book = new BookEntity(Id);
}
public BookType BookType {
get { return this.bookType; }
set {
this.bookType = value;
this.book.BookType = new BookTypeEntity(value.ID);
this.book.Save();
}
}
public int CountPages() { }
}
Identifying object fields, such as properties, seems inconvenient as I am matching again. With list types, this is even much worse, since I have to write the Add and Remove methods plus the property that the list provides.
BookType BookTypeEntity, , , BookType. .
, BookEntity -? , , ?
LLGLGen , . , - (, CountPages) .