Hi,
I have an existing app where the EF entities have been coded manually using attributes.
Example:
[Table("DepartmentAccess", Schema = "dbo")]
public class DepartmentAccess
{
[Key, Column("ID")]
public int DeptAccessID { get; set; }
[Required, Column("Department")]
public string CostCentreID { get; set; }
[Required, Column("Mnemonic")]
public string GivenToAdUsername { get; set; }
[Required]
public bool FullAccess { get; set; }
[Required]
public DateTime CreateDate { get; set; }
}
I want to be able to generate similar code with LLBLGP so I don't have to write it by hand.
I've been able to add the attributes in the Project settings. It works very nicely especially the conditions, however, I have some issues:
- Some tables have composite primary keys. Is there an attribute macro that I can use to return the order of the PK field. I need to generate: [Column("PKField1", Order=1)].
- I need to add a ForeignKey attribute pointing to the name of the navigator. Is there a way to retrieve that?
[Column("DepartmentId"), ForeignKey("Department")]
public int DepartmentId {get; set;}
public virtual Department {get; set;}
Thanks!