Page 1 of 1

How to create FieldName const strings and Indexes

Posted: Tue 04 Sep 2018 02:04
by MarkLFT
We currently use Lightspeed ORM, and have been for a number of years. But we are now looking towards using EF Core with Entity Developer for our ORM toolkit. There is however as couple of items I m having issues with.

Firstly, when Lightspeed created the classes, for each of the public properties, then also created a public const string with the field name. e.g.

public string GuestName { get; set; }
public const string GuestNameField = "GuestName"; <--- This is what I need

What I want to know, is , is there a way to create these without me getting in to modifying templates?

Secondly, I have created a database first model, but it did not seem to import any indexes. Our database has a lot of tables, and each has two or three indexes to improve performance, do I need to code all of these manually?

Many thanks for your help.

Re: How to create FieldName const strings and Indexes

Posted: Fri 07 Sep 2018 13:58
by Pinturiccio
MarkLFT wrote:What I want to know, is , is there a way to create these without me getting in to modifying templates?
The only way is to edit a template.
MarkLFT wrote:Secondly, I have created a database first model, but it did not seem to import any indexes. Our database has a lot of tables, and each has two or three indexes to improve performance, do I need to code all of these manually?
Entity Developer retrieves the information only for unique indexes. In practice, database indexes, that are not unique, but created for improving performance, usually have a lot of different parameters set, not just a column list. Full-featured support for them is outside of the scope of ORM designer features, because ORMs don't use this information.