Hi @aaron
it works!
Thanks a lot for your support!
I don't have an error but if i try to search the interface it isn't registered.
No
I found a problem but it is manual. The strange situation is that everything works except and when the class inherits from BackGround Job
@maliming Thanks a lot
Yes. So I try to use NSWAG and I've generated the Script in AngularJs. We need to convert our solution in 2 step, 1 .NET -> Core, 2 UI. In this path the method removed (create angularjs script) create this issue so we try to use NSwag.
Actualy we have a MVC project converted to AngularJs and we move our AngularJs from JS to TypeScript. I thik a lot of aspnetzero can be in the same situation if it start to work on this framework since verion 0.7.0 :)
I @ismcagdas
we start to move our solution from .NET -> .NETCore so after some internal discussion we start from MVC project and customize/dupliate the x.Web.Mvc module (because this module is a front-end app like .Web.Host or .Web.Public).
Our first step is create an AngulrJs App and after full moved to NETCore plan to migrate from AngularJs to Angular.
We find a first issue i create the AngularJs js client for ABP AngularJs Client Proxy the suggestion is to use "nswag tool" but it generate only TypeScript Client and our AngularJs is actually written on JS. Is all correct or I missing somthing? Which is the best way to approch this problem?
Hi maliming
sorry for the delay.
Thanks for your response, we move our CustomDto with manual mapping.
Regards
Because I need to get data on Prev state. The Goal is to get data for entity before save and new value beacuse I need to compare one value and decide if is changed I need to do an operation.
EventBus Changeing is too late for that goal beacuse happen after saveChanges and the data is alredy into the database.
So now I try to override the saveChanges method to achive my goal
Update I think EventBus Event Updateing is too late to implements my need. I think the only way is override SaveChanges
this is the full class
public abstract class WorkFlowBase<TEntity,TEntityKey> :
IDomainService,
IWorkFlow,
IEventHandler<EntityCreatingEventData<TEntity>>,
IEventHandler<EntityUpdatingEventData<TEntity>>,
IEventHandler<EntityDeletingEventData<TEntity>>
where TEntity : class, IEntity<TEntityKey>, new()
{
private readonly IWorkFlowManager _workFlowManager;
private readonly IUnitOfWorkManager _unitOfWorkManager;
private readonly IRepository<TEntity, TEntityKey> _entityRepository;
public ILogger Log { get; set; }
protected WorkFlowBase(IWorkFlowManager workFlowManager, IUnitOfWorkManager unitOfWorkManager,
IRepository<TEntity, TEntityKey> entityRepository)
{
_workFlowManager = workFlowManager;
_unitOfWorkManager = unitOfWorkManager;
_entityRepository = entityRepository;
Log = NullLogger.Instance;
}
public void HandleEvent(EntityCreatingEventData<TEntity> eventData)
{
CallWorkFlow(eventData, EventOperation.Creating);
}
private void CallWorkFlow(EntityChangingEventData<TEntity> eventData, EventOperation operation)
{
var type = typeof(TEntity);
// Gat snapshot of data
var oldEntity = new TEntity();
var outerUow = _unitOfWorkManager.Current;
using (var uow = _unitOfWorkManager.Begin(new UnitOfWorkOptions
{
Scope = TransactionScopeOption.RequiresNew,
IsTransactional = true,
IsolationLevel = IsolationLevel.ReadUncommitted
}))
{
if (outerUow != null)
{
_unitOfWorkManager.Current.SetTenantId(outerUow.GetTenantId());
}
oldEntity = _entityRepository
.GetAll()
.AddEntityFilterId(eventData.Entity).FirstOrDefault();
uow.Complete();
}
}
public void HandleEvent(EntityDeletingEventData<TEntity> eventData)
{
CallWorkFlow(eventData, EventOperation.Deleting);
}
public void HandleEvent(EntityUpdatingEventData<TEntity> eventData)
{
CallWorkFlow(eventData, EventOperation.Deleting);
}
}
public enum EventOperation
{
Creating,
Updating,
Deleting
}