*Id
in the constructor doesn't query the related entities from the database, so they're null
.Code
or Description
in the form fields? Show code used for setting the form fields.Because your code will not be easy to test. You can use the Property Injection pattern.
Why use IocManager.Instance
?
Related issue with workaround: aspnetboilerplate/aspnetboilerplate#3082
- what project do we implement this so that these WebAPI calls will be accessible within both the MVc and the Host proect
Web.Core project.
- How do we set a custom route for these calls? I can't seem to get custom routes working in any Abp or AspNetZero projects
[Route("")] attribute.
- How do we ensure these calls are included in our Swagger UI?
[RemoteService] attribute.
Yes. At the end of the method, the transaction is committed and the connection is disposed.
You can read about IUnitOfWorkManager in the documentation on Unit Of Work.
It's inserted but not committed. To commit it, you can complete a new unit of work.
using (var uow = _unitOfWorkManager.Begin(TransactionScopeOption.RequiresNew)) {
var id = await _repository.InsertAndGetIdAsync(obj);
await uow.CompleteAsync();
}
What coin?
Your server may lack support for Abp.TenantId header: https://github.com/aspnetboilerplate/aspnetboilerplate/issues/3374
ABP registers repositories based on DbSets. Try:
public virtual DbSet<MyQuery> MyQueries { get; set; }
Why would there be a new way? That's already simple and minimal.