forum

Home / DeveloperSection / Forums / IList<string> datatype field not being incorporated into table definition asp.net MVC

IList<string> datatype field not being incorporated into table definition asp.net MVC

Anonymous User252323-Dec-2013

I have the following model class:-

public class EventReg

{

    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]

    public int ID { get; set; }

    [Display(Name = "Event Date")]

    [DataType(DataType.Date)]

    [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]

    public DateTime? EventDate { get; set; }

    [Display(Name = "Event Time")]

    [DataType(DataType.Time)]

    [DisplayFormat(DataFormatString = "{0:t}", ApplyFormatInEditMode = true)]

    public DateTime? EventTime { get; set; }

    public IList<string> HashTags { get; set; }

    public string Category { get; set; }

    [Display(Name = "Registered by")]

    public string UniqueId { get; set; }

    public float Latitude { get; set; }

    public float Longitude { get; set; }

    public string Description { get; set; }            

}

In my Package-Manager-Console I typed Enable-Migrations -ContextTypeName CampusConnect.Models.EventDBContext(EventDBContext is my database ) to create a configuration.cs file.

 I didn't add any data into the seed method. then I did add-migration initial to create an intial.cs file which would allow my project to update my database schema. Now when I did update-database each field appeared in the table definition except the HashTag field. 

Can anyone tell me, why?


Updated on 23-Dec-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By