Domain service methods are not conventional unit of work methods.
Alternatively, you can use [UnitOfWork] attribute for:
- All public or public virtual methods for classes those are used over interface (Like an application service used over service interface).
- All public virtual methods for self injected classes (Like MVC Controllers and Web API Controllers).
- All protected virtual methods.
Begin a UnitOfWork:
using (var uow = UnitOfWorkManager.Begin())
{
var users = _userManager.Users.ToList();
uow.Complete();
}
You can inherit FullAuditedEntity<int, User> instead.
It's fine. You'll get the hang of it in time to come!
You can DisableFilter for IMayHaveTenant:
using (_unitOfWorkManager.Current.DisableFilter(AbpDataFilters.MayHaveTenant))
{
var settings = _settingRepository.GetAllList();
}
Read the documentation on Data Filters.
Are you using EF Core? If yes, then you need to use GetAllIncluding for CreatorUser:
var query = _provinceRepository
.GetAllIncluding(p => p.CreatorUser)
// ...
AutoMapper will handle the mapping.
Note:
From the documentation on Data Filters:
You can disable a filter per unit of work by calling DisableFilter method as shown below:
using (_unitOfWorkManager.Current.DisableFilter(AbpDataFilters.SoftDelete)) { var people2 = _personRepository.GetAllList(); }
people2 will also include deleted people.
Previously asked: <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/issues/583">https://github.com/aspnetzero/aspnet-zero/issues/583</a>
<cite>hikalkan: </cite> you can easily replace it by overriding abp.ui.setBusy and abp.ui.clearBusy javascript functions. <cite>acjh: </cite> Create a file like abp.spin.js and replace (or add after) wherever that file is used.
Thanks for letting us know!
Inject IRepository<Setting, long> and do as you would for any other entity.