First I would like to say great product.
As I work with the tool there are things I would like to see to make our life even simpler.
I’m wondering if IdeaBlade should start a Feature Request Form.
Here is one feature that should be a relatively easy addition that would make our life’s simpler.
In the DevForce EF Object Mapper I would like you to extend the code generator option under the “Create developer classes” to include “Include stub Create Methods”. It would generate stub code below. I would say that 99% of the objects will need to “add” and at minimum this is the code required to do it.
public static Customer Create(EntityManager entityManager) {
Customer aCustomer = entityManager.CreateEntity<Customer>();
aCustomer.EntityAspect.AddToManager();
return aCustomer;
}
If you wanted to take it furher you could add something that would ask for the “other” items you would want in the constructor say Include Key creation, initilaze String to something etc. like from the sample of your sample app.
public partial class Customer {
public static Customer Create(EntityManager entityManager, string companyName) {
Customer aCustomer = entityManager.CreateEntity<Customer>();
// Customer key is a single property, guid-valued
DataEntityProperty key = aCustomer.EntityAspect.EntityMetadata.KeyProperties[0];
aCustomer.SetRawValue(key, System.Guid.NewGuid());
aCustomer.CompanyName = companyName;
aCustomer.EntityAspect.AddToManager();
return aCustomer;
}
That way every time I wanted to add a new record I would know to call create on it as in.
Customer newCustomer = Customer.Create(_entityManager);
This would be great thanks.