0
**public class Ticket : BaseEntity
    {       
        public TicketType TicketType { get; set; } 
    }
public class TicketType : AuxiliaryInfoBaseEntity
    {     
        public string Description { get; set; }
    }**

In Ticket Entity i need one property of TicketType and type of column should be byte in Ticket. Resulting table will look like.Table-Ticket:column TicketType(tinyint,not null). When i trying to migrate, i am getting this exception. System.InvalidOperationException: 'The property 'Ticket.TicketType' is of type 'TicketType' which is not supported by current database provider. Either change the property CLR type or ignore the property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. Please help me with some soluntion thanks.

  • Could you share what is your `BaseEntity` and `AuxiliaryInfoBaseEntity` and your DbContext? – Rena Dec 17 '19 at 09:19
  • public Guid Id { get; set; } public DateTime CreatedAt { get; set; } static BaseEntity() { Triggers.Inserting += entry => { entry.Entity.CreatedAt = DateTime.UtcNow; entry.Entity.IsDeleted = false; entry.Entity.IsActive = true; }; Triggers.Deleting += entry => { entry.Entity.DeletedAt = DateTime.UtcNow; entry.Entity.IsDeleted = true; entry.Cancel = true; } – mohan chichila Dec 18 '19 at 06:32
  • This is base entity – mohan chichila Dec 18 '19 at 06:32
  • AuxiliaryInfoBaseEntity { public byte Id { get; set; } public bool IsActive { get; set; } public AuxiliaryInfoBaseEntity() { Triggers.Inserting += entity => { entity.Entity.IsActive = true; }; } } – mohan chichila Dec 18 '19 at 07:07
  • class WriteOnlyContext:DbContext { public DbSet Tickets { get; set; } public WriteOnlyContext(DbContextOptions options) : base(options) { } public WriteOnlyContext() : base() { } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { dbconnection } protected override void OnModelCreating (ModelBuilder builder) { base.OnModelCreating (builder); builder.ConfigureTicket (); } } – mohan chichila Dec 18 '19 at 07:46

0 Answers0