Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

How to rename a string/column ID from Entity Framework generated classes?

$
0
0

Hey guys,

I currently have a generated code from Entity Framework. My table is called "Authors", but I am trying to change my column names to become more clean and professional. For example I want to change my "au_id" column to something like "Author ID". This is the code-behind for my table (I am assuming all changes I need to make to the column names would be done on the code-behind). 

_______________

    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;

    public partial class author
    {
        public author()
        {
            this.titleauthors = new HashSet<titleauthor>();
        }

        public string au_id { get; set; }
        public string au_lname { get; set; }
        public string au_fname { get; set; }
        public string phone { get; set; }
        public string address { get; set; }
        public string city { get; set; }
        public string state { get; set; }
        public string zip { get; set; }
        public bool contract { get; set; }

        public virtual ICollection<titleauthor> titleauthors { get; set; }

    }
}


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>