While I am going to add-migration it's ok but while I am going to run update-database I am getting this type of error in package manager console
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_dbo.ServiceTypes_dbo.Services_ServiceTypeID". The conflict occurred in database "Otaidea", table "dbo.Services", column 'ServicesID'.
My two model:
public class Services
{
[Key]
public int ServicesID { get; set; }
[DisplayName("Register Date")]
public DateTime RegisterDate { get; set; }
public int ServiceTypeID { get; set; }
public string ApplicationUserID { get; set; }
public virtual ServiceType ServiceType { get; set; }
public virtual ApplicationUser ApplicationUser { get; set; }
}
my another Table:
public class ServiceType
{
[ForeignKey("Services")]
public int ServiceTypeID { get; set; }
public string NAME { get; set; }
public virtual Services Services { get; set; }
}