public void LoadFromDomain(DonVo.CQRS.Standard21.Domain.Model.Company.VacationType entity) { Id = entity.Id; Name = entity.Name; DefaultLeaveDays = entity.DefaultLeaveDays; IsPassing = entity.IsPassing; PoolId = entity.Pool?.Id; PoolName = entity.Pool?.Name; RowVersion = Convert.ToBase64String(entity.RowVersion); }
public async Task <int> Handle(InsertVacationTypeCommand request, CancellationToken cancellationToken) { var pool = await VacationTypeRepository.Get(request.PoolId.GetValueOrDefault(0)); var vacationtype = new DonVo.CQRS.Standard21.Domain.Model.Company.VacationType(request.Name, request.DefaultLeaveDays, request.IsPassing, pool); var id = await VacationTypeRepository.Insert(vacationtype); await Mediator.Publish(new VacationTypeInsertedEvent { Id = vacationtype.Id }); return(id); }