I think I have found part of the problem. Many months ago I added the option for Swagger
options.CustomSchemaIds(type => type.FullName);
as I was getting and error casued by a third party class that had some of the same name for entites that I had.
This appended information to the name to make it unique. I am not sure why though it is now appending all the extra information and causing the erro.
For now I have removed the CustomerSchemaIds option and just renamed my entities.
Thanks, that helped. Rather than worrying about the current online users I just, for now, did a broadcast message and it worked!! It is not as secure but the payload is not really confidential and the client would still need to have the credentials to the Azure SignalR connection.
Thanks. I gave up and just put the chart in a separate page by itself rather than as a tab in an existing page and it appears properly. I think it may have had something to do with a tabset in a tabset?
Thank you for your help. I was able to resolve the issue.
There were actually two things I needed to correct the problem. I didn't realize I needed the [UnitOfWork] attribute in the Controller (I had it disabled on the API) Also, I was not calling the API Asynchronously.
Thanks but I tried that if I start a new unit of work it causes the line
CheckErrors(await _roleManager.CreateStaticRoles(tenant.Id));
to give me the following error:
System.ObjectDisposedException: Cannot access a disposed object. Object name: 'RoleManagerProxy'.
Why does the CreateAsync(tenant) end the UnitOfWork
using (var uow = _unitOfWorkManager.Begin(TransactionScopeOption.RequiresNew))
{
//Create tenant
var tenant = new Tenant(tenancyName, name)
{
IsActive = isActive,
EditionId = editionId,
SubscriptionEndDateUtc = subscriptionEndDate?.ToUniversalTime(),
IsInTrialPeriod = isInTrialPeriod,
ConnectionString = connectionString.IsNullOrWhiteSpace() ? null : SimpleStringCipher.Instance.Encrypt(connectionString),
Address = address,
City = city,
Region = region,
PostalCode = postalCode,
Phone = phone,
EmailAddress = emailAddress
};
await CreateAsync(tenant);
await _unitOfWorkManager.Current.SaveChangesAsync(); //To get new tenant's id.
//We are working entities of new tenant, so changing tenant filter
using (_unitOfWorkManager.Current.SetTenantId(tenant.Id))
{
//Create static roles for new tenant
CheckErrors(await _roleManager.CreateStaticRoles(tenant.Id));
await _unitOfWorkManager.Current.SaveChangesAsync(); //To get static role ids
Just tried calling the CreateRestaurantTenant(tenant) using the _tenantRegistrationAppService class and got the same error.
[HttpPost]
public IActionResult Index(MerchantIndexViewModel input)
{
...
//validation
...
//Initialize tenant object
...
//Call to the API
_tenantAppService.CreateRestaurantTenant(tenant);
Thanks. Yes, that is what I did. It was a little tedious but it works.
Thanks. I added a bit of a hack to the CustomDefaultSchemaIdSelector to differentiate between these two Customer classes for now. It seems to be working.