c# - How to map class to database table? -


i'm have classes , need make data tables follow class 1

   public class eventtype    {          public string id { get; private set; }         public int severity { get; set; }         public eventtypetemplate template { get; set; }         public idictionary<string, string> params { get; set; }         public eventtype(string id)         {              id = id;             params = new dictionary<string, string>();         }    } 

and second class

public class eventtypetemplate {      public string id { get; private set; }      public int severity { get; set; }      public string title { get; set; }      public string description { get; set; }      public ilist<string> categories { get; private set; }      public ilist<string> queries { get; private set; }      public eventtypetemplate(string id)      {            id = id;categories = new list<string>();           queries = new list<string>();      }  } 

for class 1(eventtype) create table table name eventtype

column    type id        string severity  int 

and don’t know how enterprate these property table column name , type

public eventtypetemplate template { get; set; } public idictionary<string, string> params { get; set; } 

for second class create table name eventtypetemplate

column          type id              string severity        int title           string description     string 

but don’t know how enterprate follow property table column name , type

public ilist<string> categories { get; private set; } public ilist<string> queries { get; private set; } 

any appreciated

for template, in eventtype table, add foreign key eventtypetemplate (eventtypetemplateid):

eventtype --------- column              type id                  string severity            int eventtypetemplateid int  

for params create params table 3 columns:

params ------ column       type eventtypeid  string key          string value        string 

for categories create table called categories:

categories ---------- eventtypetemplateid string categoryname        string   

for queries create table called queries:

queries ---------- eventtypetemplateid string query               string   

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -