You don't need ForeignKey attribute, it will be configured by convention: https://docs.microsoft.com/en-us/ef/core/modeling/relationships#conventions
In this scenario both tables MMTABS & MMODL has same coulmn named Id as PK. so, how could make a FK relationship with convention method.
[Table("MMTABS")] public class ASAPTabsEntity : FullAuditedEntity {
public virtual int Id{get;set;}
public virtual ASAPModulesEntity ASAPModulesEntities { get; set; } public virtual int Id { get; set; } }
[Table("MMMODL")] public class ASAPModulesEntity : FullAuditedEntity { public virtual int Id{get;set;}
public virtual ICollection<ASAPTabsEntity> ASAPTabsEntities { get; set; }
}
even It throws as , To change the IDENTITY property of a column, the column needs to be dropped and recreated.
Thanks , going through the doc and let you know.
yes, MMTABS have a default column named Id as PK.
though Id is also the PK OF MMODL table.
hence, How do I make relationship between MMODL and MMTABS.
here, [ForeignKey("Id")] it is not the PK of the MMTABS table, as it is PK of the MMMODL table trying to create one to many relationship with MMMODL and MMTABS
hence I have written the above
After migration, update-databse -verbose throwing the below error
To change the IDENTITY property of a column, the column needs to be dropped and recreated.
[Table("MMTABS")]
public class ASAPTabsEntity : FullAuditedEntity
{
[ForeignKey("Id")]
public virtual ASAPModulesEntity ASAPModulesEntities { get; set; }
public virtual int? PARENT_MODULE_ID { get; set; }
}
[Table("MMMODL")]
public class ASAPModulesEntity : FullAuditedEntity
{
public virtual ICollection<ASAPTabsEntity> ASAPTabsEntities { get; set; }
}
here, [ForeignKey("Id")] it is not the PK of the MMTABS table, as it is PK of the MMMODL table trying to create one to many relationship with MMMODL and MMTABS
hence I have written the above
I have followed all the steps exactly as you mentioned here to publish our APP to Azure. https://docs.aspnetzero.com/documents/zero/latest/Step-by-step-publish-to-azure-angular
But after following all the steps and when I launch the web app, I'm getting http error 502.5 - ancm out-of-process startup failure
Please let me know what I'm missing here. Or give us some additional steps to trouble shoot the issue in Azure.
I have followed all the steps exactly as you mentioned here to publish our APP to Azure. https://docs.aspnetzero.com/documents/zero/latest/Step-by-step-publish-to-azure-angular
But after following all the steps and when I launch the web app, I'm getting http error 502.5 - ancm out-of-process startup failure
Please let me know what I'm missing here. Or give us some additional steps to trouble shoot the issue in Azure.
I have deployed in IIS(Port no: 2020).My appsettings.json
"ConnectionStrings": {
"Default": "Server=DESKTOP-KSUS4BB\\PRO; Initial Catalog=PRODb;User ID=sa;Password=password@123"
},
"AbpZeroLicenseCode": "LicenseCodePlaceHolderToReplace",
"Abp": {
"RedisCache": {
"ConnectionString": "localhost",
"DatabaseId": -1
}
},
"App": {
"ServerRootAddress": "http://localhost:22742/",
"ClientRootAddress": "http://localhost:4200/",
"CorsOrigins": "http://*.mycompany.com,http://localhost:4200,http://localhost:2020/",
"SwaggerEndPoint": "/swagger/v1/swagger.json",
"AllowAnonymousSignalRConnection": "true"
},
My appsettings.Production.json
{
"ConnectionStrings": {
"Default": "Server=DESKTOP-KSUS4BB\\PRO; Initial Catalog=PRODb;User ID=sa;Password=password@123"
},
"App": {
"ServerRootAddress": "http://localhost:9901/",
"ClientRootAddress": "http://localhost:4200/",
"CorsOrigins": "http://localhost:2020/"
}
}
I am also getting same error. I have deployed in IIS(Port no: 2020).My appsettings.json
"ConnectionStrings": {
"Default": "Server=DESKTOP-KSUS4BB\\PRO; Initial Catalog=PRODb;User ID=sa;Password=password@123"
},
"AbpZeroLicenseCode": "LicenseCodePlaceHolderToReplace",
"Abp": {
"RedisCache": {
"ConnectionString": "localhost",
"DatabaseId": -1
}
},
"App": {
"ServerRootAddress": "http://localhost:22742/",
"ClientRootAddress": "http://localhost:4200/",
"CorsOrigins": "http://*.mycompany.com,http://localhost:4200,http://localhost:2020/",
"SwaggerEndPoint": "/swagger/v1/swagger.json",
"AllowAnonymousSignalRConnection": "true"
},
My appsettings.Production.json
{
"ConnectionStrings": {
"Default": "Server=DESKTOP-KSUS4BB\\PRO; Initial Catalog=PRODb;User ID=sa;Password=password@123"
},
"App": {
"ServerRootAddress": "http://localhost:9901/",
"ClientRootAddress": "http://localhost:4200/",
"CorsOrigins": "http://localhost:2020/"
}
}