Can you show the error in Logs.txt?
The current log file is locked when the solution is working so I'm not sure how you would go about retrieving current errors in a production environment?
As mentioned, use your File Explorer.
Check if you included these lines in your page:
<script src="~/Abp/Framework/scripts/libs/angularjs/abp.ng.js"></script>
<script src="~/api/AbpServiceProxies/GetAll?type=angular"></script>
<script src="~/Abp/Framework/scripts/abp.js"></script>
Maybe related: https://github.com/aspnetboilerplate/aspnetboilerplate/issues/444
That doesn't look like the full stack trace.
Can you show the full stack trace? (Next time, just bump the other post if it's the same issue.)
To include nested relationships, add using Microsoft.EntityFrameworkCore; and do:
var company = await _companyRepository
.GetAllIncluding(
c => c.Patients,
c => c.CompanyEmails,
c => c.CompanyPhones
)
.Include(c => c.CompanyAddresses)
.ThenInclude(ca => ca.Address)
.FirstOrDefaultAsync(o => o.Id == input.Id);
Use your File Explorer, not Visual Studio.
A domain service (conventionally with the Manager postfix, e.g. AddressManager) simply injects the necessary repositories (or DbContextProvider) and performs almost everything you are doing in your AddressAppService. So your AddressAppService is simply a wrapper accessible on client side, that injects AddressManager and calls the methods. Then CompanyAppService injects AddressManager instead of AddressAppService, preserving a clear dependency hierarchy while avoiding duplicate or error-prone code in CompanyAppService to do the same thing.
For sample code, you can refer to AbpTenantManager.
Check your Web.Host project.
First of all what is the best way to add a record to the non-entity table (CompanyAddress).
That looks fine. Is it a many-to-many or one-to-many relationship?
So in the CompanyAppService.AddAddress should I be creating an instance of the AddressAppService and using the insert method to create the address? Or should I just create the record directly like I'm doing with CompanyAddress?
You should use a domain service/manager instead. See detailed answers: Should I be calling an AppService from another AppService?.
Should I be using UoW for this or just do an insert of the address and if it succeeds, attempt to add a record to CompanyAddress and if that fails, remove the address?
That's a good use case for UnitOfWork. Note that if it's triggered by an AppServicecall, UnitOfWorkis automatically started. Simply throw an exception and ABP will handle the rollback (or commit if there is no exception).