Hello,
I am migrating an ASP.NET MVC4 Razor application from EF4 to LLBLGEN 3.5 and your runtime. The application has many layers, which would be difficult to rework/rename. I've generated an initial version of LLBLGEN Adapter, single class code, and am hoping that it would be easy to make a few changes to what is generated by your product:
1) Is it easy to change the naming of the generated entities from EntitynameEntity
toBaseEntity? For example, rather than generating CustomerEntity, it would be
better for us to generate BaseCustomer.
2) In our current project, we have a partial class file named AnnotatedXXXX for each
generated entity, where XXXX is the name of the class. It contains a partial class of a
generated class. The reason it exists is to easily attach data annotations to fields in
the entity.
Can I simply copy our existing versions of these files and change their parent class to
the one that LLBLGEN created? For example,
You generated CustomerEntity.cs:
public partial class CustomerEntity : CommonEntityBase
{
public long CustomerId { get; set; }
.
.
}
Can I simply do the following in AnnotatedBaseCustomer.cs (change the parent class
to your class)?
[MetadataType(typeof(CustomerEntityMetadata))]
public partial class CustomerEntity
{
internal sealed class CustomerEntityMetadata
{
[Key]
[Display(Name = "Title_Id", ResourceType = typeof(Resources))]
public long CustomerId { get; set; }
}
}
This simply applies data annotations to the entities that you've created.
Alternatively, I know that I can enter the data annotations using your editor, but there
are a lot of them, so this would be a tedious task. Is there any way I could
import/cut-n-paste them into LLBLGEN rather than having to use the editor and enter
them one by one by one? After they are in your tool, then we wouldn't need to use the
Annotated versions of these classes because LLBLGEN would simply emit them in your
generated code.
3) In another class library, which is our business layer, we subclass from the generated
entities and add our business logic/rules to each entity. Are there any special rules
that we must observe when subclassing from your entities? I noticed that when you
generate adapter, two-class code, there are a lot of functions generated, and our code
would go into a specific region. Since we are not generating these files via LLBLGEN, I
would assume that there are no special rules or sections. Is that true?
Thank you for your help!
Mike