> Doesn't it involve a lot of time rewriting my generated collections (which i can use as datasources) to BindingList(of Entities), while keeping the same functionality as the original collections? (e.q. loading by query, or loadall functionality...)First, I agree that
First, I agree that this isn't an ES issue. It has to to do with .NET and the choices made by MS (Microsoft) as well as the choices made by each individual developer to accommodate the framework supplied by MS.
I am just trying to help and to explain everything would certtainly take a great deal of time. However - personally - I don't think it takes that much time. Alternatively, you can use a BindingSource and use it's ResetItem method. See example here:
http://www.dotnetspider.com/resources/2302-Binding-Source-Net.aspx
Frankly, there are many ways to design an application. For example, I run my applications in N-Tiers where there is a client application (the client forms), a client manager controls all data requests and each form interacts with the manager via proxy stubs; the manager communicates via WCF to a service; the service process requests by deserializing the proxy stub objects and loading them into the generated classes and communicates various requests via WCF to the database or databases and/or other services. It is, obviously, more complicated than a basic description can provide.
For me, having the generated output be BindingList(Of T) collections would make no sense because my service does not data bind at all, the client forms do and they interact with proxy stubs.
I understand what you want: the generated output to be complete, but then I ask you this:
How do you validate the entries made by your users?
If you register with validating events on forms and add code to the form, then you are building form-by-form anyway and I don't understand the big deal.
If you are trying to avoid duplication and speed up the design of forms as well as reduce future maintenance time - then you would use some form of Model/View/Controller design: I use my own version. It takes more time up front but reduces and simplifies the process over time. Within the controller/manager is where you design wrapper for your business objects so they bind appropriately as well as handle validation. To give an example: if you allow users to enter an email address and you decide to use RegEx check for a specific pattern to ensure the address is valid, you would have one place where that code is located. You then apply "rules" for each object and tell the object that XXX field needs to pass the "IsValidEmail" rule and supply a meessage for when it does not. In fact, you will likely have scenarios for multiple rules for a single field, let alone the whole object.
Using a centralized approach, if the email address rule changes, you change one spot and all objects/forms applying the rule are updated. Using the form-by-form approach, you would have to manually correct every form.
I suspect you might want to look into Model/View/Controller and other similar designs.
There are a LOT of resources and VIDEOS regarding the subject.
I can only say that I have tested many ORM tools and several licenses. I honestly believe that ES is the the best and the only one that works well in a N-Tier application. However, this is just one man's opinion.