Hi,
I need to send a notification from an ApplicationService defined in a custom module, I successfully managed to add a new notification type to the default AppNotificationProvider defined in the core module, but when I try to replicate the same in another module the notification wont show up, even its not save in the database.
So in my custom module i have the following:
I got no error and yet the notification is not saved in the database and of course not sent to the client, even the user is subscribed to this type of notification.
What i am missing do i need to call _notificationSubscriptionManager.SubscribeToAllAvailableNotificationsAsync before i invoke the method on appNotifier like in the AccountController?
Thank you.
Hi,
How to achieve Dto inheritence in order for base and derived class map correctly to their correspondent Dto?
in the following example, i am always getting the ProductDto even if the product is a ProductA instance, how to make it map to ProductADto?
public class Product {}
public class ProductA : Product {}
[AutoMap(typeof(Product)]
public class ProductDto {}
[AutoMap(typeof(ProductA)]
public class ProductADto {}
public class GetProductForEditOutput
{
public Product EditProduct { get; set; }
}
Hi,
In my application service i need to connect to an external database using ODBC, this database provider doesn't support transaction, and it causing problem with the default transnational nature of application service methods.
The solution was to add the [UnitOfWork(IsDisabled = true)] attribute and define my own scope for the code part that needs to interact with the SQL server database using UnitOfWorkManager.Begin() method. However the behavior I am getting is different if I execute the SQL server part alone in an application service methods.
What I Have so far:
[UnitOfWork(IsDisabled = true)]
public async Task DeleteObject(DeleteObjectInput input){
//connect to external engine
//perform SQL server logic
var unitOfWorkOptions = new UnitOfWorkOptions() { IsTransactional = true };
unitOfWorkOptions.FilterOverrides.Add(new DataFilterConfiguration(AbpDataFilters.SoftDelete, false));
using (var unitOfWork = UnitOfWorkManager.Begin(unitOfWorkOptions))
{
var object = await _objectRepository.GetAsync(input.Id);
//perform some logic
await _objectRepository.DeleteAsync(object );
await unitOfWork.CompleteAsync();
}
}
The object class has a List of other sub-objects and a one to one relation with another extend-object. When i execute the above code only the object is marked as deleted and the dependent objects are intact, while if i execute the same code directly in an application service methods all the dependent object are marked as deleted.
Another point, I assume disabling the SoftDelete filter is enough to completely remove the objects from the database, which is not the case (apparently it works only on the select), do I need to execute a raw SQL query to achieve this behavior?
Thank you.
Hi,
In my application service, I need to send additional data to the client when I throw UserFriendlyException, so I created my own exception class that inherit UserFriendlyException and added my own custom properties.
However on the client side, when calling the application service method, I am unable to get the new custom properties added, do i need to register my custom exception somewhere?
Also on the client side and based on the error code thrown, i need to provide my own handling and prevent the default error message that appears, how to cancel this behavior based on error code.
ex:
vm.save = function () {
vm.saving = true;
appService.update(vm.entity)
.then(function () {
abp.notify.info(app.localize('SavedSuccessfully'));
$uibModalInstance.close();
}, function (result) {
<ins>//I want to cancel the default error message and show my own handling with the new custom properties</ins>
vm.saving = false;
}).finally(function () {
vm.saving = false;
});
};
Hi,
I am trying to achieve something similar to the OU concept called data labeling, where each entity will have some labels assigned to it and the users can only access the entities matching his security settings. Currently the implementation for the organization units doesn't restrict user access for the entities that belongs to the OU that they have access to.
I know that the datafilters concept is a potential solution to handle this kind of controls, do you have any recommendations to point me in the right direction?
Hi,
I noticed in the TenantAppService there is an injection for _tenantManager in the constructor although in the base class there is a property called TenantManager, any difference between the two?
Also why CrudAppService/AsyncCrudAppService is not used in the project and all the CRUD are re implemented, any specific reason behind this design? Can TenantAppService inherit AsyncCrudAppService and implement only the missing methods, while providing the appropriate values for the CRUD permission names ?
Thanks