Skip to content

Need attributes to be added to the data models #6

@alex4998

Description

@alex4998

In all my models I have table names and columns not matching to the class names and properties. For example it generated this class:

public partial class SettingsItem
{
	[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
	[Key]
	public long ID { get; set; }

	[MaxLength(50)]
	[Required]
	public string Name { get; set; }

	[MaxLength(2147483647)]
	public byte[] Value { get; set; }

	public DateTime Created { get; set; }

	public DateTime? Updated { get; set; }

}

but in my case it won't work. I need it to be this

[Table("t_settings")]
public partial class SettingsItem
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key]
[Column("fID")]
public long ID { get; set; }

	[MaxLength(50)]
	[Required]
  [Column("fName")]
	public string Name { get; set; }

	[MaxLength(2147483647)]
  [Column("fValue")]
	public byte[] Value { get; set; }

  [Column("fCreated")]
	public DateTime Created { get; set; }

  [Column("fUpdated")]
	public DateTime? Updated { get; set; }

}

All that is part of the EDMX mapping information, of course.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions