From da3b9a07736483099c1eaa12b1a429a4e7f4664c Mon Sep 17 00:00:00 2001 From: "sadik.kose" Date: Fri, 15 Sep 2023 22:30:25 +0300 Subject: [PATCH] Merge conflicts were resolved --- ...ands.CreateBankNoteForCurrencyCommand.g.cs | 17 +++++++++++++--- ...ication.Commands.CreateBookingCommand.g.cs | 7 ++++--- ....Commands.CreateCashStockOrderCommand.g.cs | 7 ++++--- ...tion.Commands.CreateCommissionCommand.g.cs | 7 ++++--- ...ication.Commands.CreateCountryCommand.g.cs | 7 ++++--- ...reateCountryTimeZoneForCountryCommand.g.cs | 17 +++++++++++++--- ...cation.Commands.CreateCurrencyCommand.g.cs | 7 ++++--- ...cation.Commands.CreateCustomerCommand.g.cs | 7 ++++--- ...cation.Commands.CreateEmployeeCommand.g.cs | 7 ++++--- ...EmployeePhoneNumberForEmployeeCommand.g.cs | 17 +++++++++++++--- ....CreateExchangeRateForCurrencyCommand.g.cs | 17 +++++++++++++--- ...mmands.CreateHolidayForCountryCommand.g.cs | 17 +++++++++++++--- ...cation.Commands.CreateLandLordCommand.g.cs | 7 ++++--- ...ommands.CreateMinimumCashStockCommand.g.cs | 7 ++++--- ...n.Commands.CreatePaymentDetailCommand.g.cs | 7 ++++--- ...Commands.CreatePaymentProviderCommand.g.cs | 7 ++++--- ...ion.Commands.CreateTransactionCommand.g.cs | 7 ++++--- ....Commands.CreateVendingMachineCommand.g.cs | 7 ++++--- .../Application.Dto.BookingCreateDto.g.cs | 6 ++---- ...plication.Dto.VendingMachineCreateDto.g.cs | 6 ++---- ...Application.Factories.BankNoteFactory.g.cs | 3 ++- .../Application.Factories.BookingFactory.g.cs | 5 +++-- ...ation.Factories.CashStockOrderFactory.g.cs | 3 ++- ...plication.Factories.CommissionFactory.g.cs | 3 ++- .../Application.Factories.CountryFactory.g.cs | 3 ++- ...tion.Factories.CountryTimeZoneFactory.g.cs | 3 ++- ...Application.Factories.CurrencyFactory.g.cs | 3 ++- ...Application.Factories.CustomerFactory.g.cs | 3 ++- ...Application.Factories.EmployeeFactory.g.cs | 3 ++- ....Factories.EmployeePhoneNumberFactory.g.cs | 3 ++- ...ication.Factories.ExchangeRateFactory.g.cs | 3 ++- .../Application.Factories.HolidayFactory.g.cs | 3 ++- ...Application.Factories.LandLordFactory.g.cs | 3 ++- ...ion.Factories.MinimumCashStockFactory.g.cs | 3 ++- ...cation.Factories.PaymentDetailFactory.g.cs | 3 ++- ...tion.Factories.PaymentProviderFactory.g.cs | 3 ++- ...lication.Factories.TransactionFactory.g.cs | 3 ++- ...ation.Factories.VendingMachineFactory.g.cs | 5 +++-- .../Domain.Booking.g.cs | 18 ++++++++++++++++- .../Domain.VendingMachine.g.cs | 18 ++++++++++++++++- .../Application.Dto.StoreCreateDto.g.cs | 6 ++---- ...ation.Factories.CountryBarCodeFactory.g.cs | 3 ++- .../Application.Factories.CountryFactory.g.cs | 3 ++- ...ion.Factories.CountryLocalNameFactory.g.cs | 3 ++- ...ication.Factories.EmailAddressFactory.g.cs | 3 ++- .../Application.Factories.StoreFactory.g.cs | 5 +++-- ...plication.Factories.StoreOwnerFactory.g.cs | 3 ++- ...pplication.Factories.WorkplaceFactory.g.cs | 5 +++-- .../Domain.Store.g.cs | 18 ++++++++++++++++- .../Dto/EntityCreateDto.template.cs | 2 ++ .../Factories/EntityFactory.template.cs | 20 +++++++++---------- 51 files changed, 245 insertions(+), 108 deletions(-) diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateBankNoteForCurrencyCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateBankNoteForCurrencyCommand.g.cs index 48e8261b47..2bdef1ee9b 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateBankNoteForCurrencyCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateBankNoteForCurrencyCommand.g.cs @@ -19,12 +19,23 @@ namespace Cryptocash.Application.Commands; public record CreateBankNoteForCurrencyCommand(CurrencyKeyDto ParentKeyDto, BankNoteCreateDto EntityDto, System.Guid? Etag) : IRequest ; -public partial class CreateBankNoteForCurrencyCommandHandler: CommandBase, IRequestHandler +public partial class CreateBankNoteForCurrencyCommandHandler: CreateBankNoteForCurrencyCommandHandlerBase +{ + public CreateBankNoteForCurrencyCommandHandler( + CryptocashDbContext dbContext, + NoxSolution noxSolution, + IEntityFactory entityFactory, + IServiceProvider serviceProvider) + : base(dbContext, noxSolution, entityFactory, serviceProvider) + { + } +} +public abstract class CreateBankNoteForCurrencyCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; - public CreateBankNoteForCurrencyCommandHandler( + public CreateBankNoteForCurrencyCommandHandlerBase( CryptocashDbContext dbContext, NoxSolution noxSolution, IEntityFactory entityFactory, @@ -34,7 +45,7 @@ public CreateBankNoteForCurrencyCommandHandler( _entityFactory = entityFactory; } - public async Task Handle(CreateBankNoteForCurrencyCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateBankNoteForCurrencyCommand request, CancellationToken cancellationToken) { OnExecuting(request); var keyId = CreateNoxTypeForKey("Id", request.ParentKeyDto.keyId); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateBookingCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateBookingCommand.g.cs index 50ef81a419..112deeb9d2 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateBookingCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateBookingCommand.g.cs @@ -30,13 +30,14 @@ public CreateBookingCommandHandler( IEntityFactory commissionfactory, IEntityFactory transactionfactory, IEntityFactory entityFactory, - IServiceProvider serviceProvider): base(dbContext, noxSolution,customerfactory,vendingmachinefactory,commissionfactory,transactionfactory,entityFactory, serviceProvider) + IServiceProvider serviceProvider) + : base(dbContext, noxSolution,customerfactory,vendingmachinefactory,commissionfactory,transactionfactory,entityFactory, serviceProvider) { } } -public partial class CreateBookingCommandHandlerBase: CommandBase, IRequestHandler +public abstract class CreateBookingCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; @@ -63,7 +64,7 @@ public CreateBookingCommandHandlerBase( _transactionfactory = transactionfactory; } - public async Task Handle(CreateBookingCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateBookingCommand request, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); OnExecuting(request); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCashStockOrderCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCashStockOrderCommand.g.cs index 312723ba48..a13239e441 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCashStockOrderCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCashStockOrderCommand.g.cs @@ -28,13 +28,14 @@ public CreateCashStockOrderCommandHandler( IEntityFactory vendingmachinefactory, IEntityFactory employeefactory, IEntityFactory entityFactory, - IServiceProvider serviceProvider): base(dbContext, noxSolution,vendingmachinefactory,employeefactory,entityFactory, serviceProvider) + IServiceProvider serviceProvider) + : base(dbContext, noxSolution,vendingmachinefactory,employeefactory,entityFactory, serviceProvider) { } } -public partial class CreateCashStockOrderCommandHandlerBase: CommandBase, IRequestHandler +public abstract class CreateCashStockOrderCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; @@ -55,7 +56,7 @@ public CreateCashStockOrderCommandHandlerBase( _employeefactory = employeefactory; } - public async Task Handle(CreateCashStockOrderCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateCashStockOrderCommand request, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); OnExecuting(request); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCommissionCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCommissionCommand.g.cs index f01d9c2f9f..a021ed9244 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCommissionCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCommissionCommand.g.cs @@ -28,13 +28,14 @@ public CreateCommissionCommandHandler( IEntityFactory countryfactory, IEntityFactory bookingfactory, IEntityFactory entityFactory, - IServiceProvider serviceProvider): base(dbContext, noxSolution,countryfactory,bookingfactory,entityFactory, serviceProvider) + IServiceProvider serviceProvider) + : base(dbContext, noxSolution,countryfactory,bookingfactory,entityFactory, serviceProvider) { } } -public partial class CreateCommissionCommandHandlerBase: CommandBase, IRequestHandler +public abstract class CreateCommissionCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; @@ -55,7 +56,7 @@ public CreateCommissionCommandHandlerBase( _bookingfactory = bookingfactory; } - public async Task Handle(CreateCommissionCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateCommissionCommand request, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); OnExecuting(request); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCountryCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCountryCommand.g.cs index 9135b6f7c9..a25401681f 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCountryCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCountryCommand.g.cs @@ -30,13 +30,14 @@ public CreateCountryCommandHandler( IEntityFactory vendingmachinefactory, IEntityFactory customerfactory, IEntityFactory entityFactory, - IServiceProvider serviceProvider): base(dbContext, noxSolution,currencyfactory,commissionfactory,vendingmachinefactory,customerfactory,entityFactory, serviceProvider) + IServiceProvider serviceProvider) + : base(dbContext, noxSolution,currencyfactory,commissionfactory,vendingmachinefactory,customerfactory,entityFactory, serviceProvider) { } } -public partial class CreateCountryCommandHandlerBase: CommandBase, IRequestHandler +public abstract class CreateCountryCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; @@ -63,7 +64,7 @@ public CreateCountryCommandHandlerBase( _customerfactory = customerfactory; } - public async Task Handle(CreateCountryCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateCountryCommand request, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); OnExecuting(request); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCountryTimeZoneForCountryCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCountryTimeZoneForCountryCommand.g.cs index f7629abfc3..c812fceeac 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCountryTimeZoneForCountryCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCountryTimeZoneForCountryCommand.g.cs @@ -19,12 +19,23 @@ namespace Cryptocash.Application.Commands; public record CreateCountryTimeZoneForCountryCommand(CountryKeyDto ParentKeyDto, CountryTimeZoneCreateDto EntityDto, System.Guid? Etag) : IRequest ; -public partial class CreateCountryTimeZoneForCountryCommandHandler: CommandBase, IRequestHandler +public partial class CreateCountryTimeZoneForCountryCommandHandler: CreateCountryTimeZoneForCountryCommandHandlerBase +{ + public CreateCountryTimeZoneForCountryCommandHandler( + CryptocashDbContext dbContext, + NoxSolution noxSolution, + IEntityFactory entityFactory, + IServiceProvider serviceProvider) + : base(dbContext, noxSolution, entityFactory, serviceProvider) + { + } +} +public abstract class CreateCountryTimeZoneForCountryCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; - public CreateCountryTimeZoneForCountryCommandHandler( + public CreateCountryTimeZoneForCountryCommandHandlerBase( CryptocashDbContext dbContext, NoxSolution noxSolution, IEntityFactory entityFactory, @@ -34,7 +45,7 @@ public CreateCountryTimeZoneForCountryCommandHandler( _entityFactory = entityFactory; } - public async Task Handle(CreateCountryTimeZoneForCountryCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateCountryTimeZoneForCountryCommand request, CancellationToken cancellationToken) { OnExecuting(request); var keyId = CreateNoxTypeForKey("Id", request.ParentKeyDto.keyId); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCurrencyCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCurrencyCommand.g.cs index 274a10266f..387272b117 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCurrencyCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCurrencyCommand.g.cs @@ -28,13 +28,14 @@ public CreateCurrencyCommandHandler( IEntityFactory countryfactory, IEntityFactory minimumcashstockfactory, IEntityFactory entityFactory, - IServiceProvider serviceProvider): base(dbContext, noxSolution,countryfactory,minimumcashstockfactory,entityFactory, serviceProvider) + IServiceProvider serviceProvider) + : base(dbContext, noxSolution,countryfactory,minimumcashstockfactory,entityFactory, serviceProvider) { } } -public partial class CreateCurrencyCommandHandlerBase: CommandBase, IRequestHandler +public abstract class CreateCurrencyCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; @@ -55,7 +56,7 @@ public CreateCurrencyCommandHandlerBase( _minimumcashstockfactory = minimumcashstockfactory; } - public async Task Handle(CreateCurrencyCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateCurrencyCommand request, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); OnExecuting(request); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCustomerCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCustomerCommand.g.cs index e7d692606f..e78d4c6e49 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCustomerCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateCustomerCommand.g.cs @@ -30,13 +30,14 @@ public CreateCustomerCommandHandler( IEntityFactory transactionfactory, IEntityFactory countryfactory, IEntityFactory entityFactory, - IServiceProvider serviceProvider): base(dbContext, noxSolution,paymentdetailfactory,bookingfactory,transactionfactory,countryfactory,entityFactory, serviceProvider) + IServiceProvider serviceProvider) + : base(dbContext, noxSolution,paymentdetailfactory,bookingfactory,transactionfactory,countryfactory,entityFactory, serviceProvider) { } } -public partial class CreateCustomerCommandHandlerBase: CommandBase, IRequestHandler +public abstract class CreateCustomerCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; @@ -63,7 +64,7 @@ public CreateCustomerCommandHandlerBase( _countryfactory = countryfactory; } - public async Task Handle(CreateCustomerCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateCustomerCommand request, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); OnExecuting(request); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateEmployeeCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateEmployeeCommand.g.cs index add664a786..454393575c 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateEmployeeCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateEmployeeCommand.g.cs @@ -27,13 +27,14 @@ public CreateEmployeeCommandHandler( NoxSolution noxSolution, IEntityFactory cashstockorderfactory, IEntityFactory entityFactory, - IServiceProvider serviceProvider): base(dbContext, noxSolution,cashstockorderfactory,entityFactory, serviceProvider) + IServiceProvider serviceProvider) + : base(dbContext, noxSolution,cashstockorderfactory,entityFactory, serviceProvider) { } } -public partial class CreateEmployeeCommandHandlerBase: CommandBase, IRequestHandler +public abstract class CreateEmployeeCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; @@ -51,7 +52,7 @@ public CreateEmployeeCommandHandlerBase( _cashstockorderfactory = cashstockorderfactory; } - public async Task Handle(CreateEmployeeCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateEmployeeCommand request, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); OnExecuting(request); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateEmployeePhoneNumberForEmployeeCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateEmployeePhoneNumberForEmployeeCommand.g.cs index c03f8fd233..75a86be4a3 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateEmployeePhoneNumberForEmployeeCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateEmployeePhoneNumberForEmployeeCommand.g.cs @@ -19,12 +19,23 @@ namespace Cryptocash.Application.Commands; public record CreateEmployeePhoneNumberForEmployeeCommand(EmployeeKeyDto ParentKeyDto, EmployeePhoneNumberCreateDto EntityDto, System.Guid? Etag) : IRequest ; -public partial class CreateEmployeePhoneNumberForEmployeeCommandHandler: CommandBase, IRequestHandler +public partial class CreateEmployeePhoneNumberForEmployeeCommandHandler: CreateEmployeePhoneNumberForEmployeeCommandHandlerBase +{ + public CreateEmployeePhoneNumberForEmployeeCommandHandler( + CryptocashDbContext dbContext, + NoxSolution noxSolution, + IEntityFactory entityFactory, + IServiceProvider serviceProvider) + : base(dbContext, noxSolution, entityFactory, serviceProvider) + { + } +} +public abstract class CreateEmployeePhoneNumberForEmployeeCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; - public CreateEmployeePhoneNumberForEmployeeCommandHandler( + public CreateEmployeePhoneNumberForEmployeeCommandHandlerBase( CryptocashDbContext dbContext, NoxSolution noxSolution, IEntityFactory entityFactory, @@ -34,7 +45,7 @@ public CreateEmployeePhoneNumberForEmployeeCommandHandler( _entityFactory = entityFactory; } - public async Task Handle(CreateEmployeePhoneNumberForEmployeeCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateEmployeePhoneNumberForEmployeeCommand request, CancellationToken cancellationToken) { OnExecuting(request); var keyId = CreateNoxTypeForKey("Id", request.ParentKeyDto.keyId); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateExchangeRateForCurrencyCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateExchangeRateForCurrencyCommand.g.cs index 673284ccdb..2ffe1264f2 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateExchangeRateForCurrencyCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateExchangeRateForCurrencyCommand.g.cs @@ -19,12 +19,23 @@ namespace Cryptocash.Application.Commands; public record CreateExchangeRateForCurrencyCommand(CurrencyKeyDto ParentKeyDto, ExchangeRateCreateDto EntityDto, System.Guid? Etag) : IRequest ; -public partial class CreateExchangeRateForCurrencyCommandHandler: CommandBase, IRequestHandler +public partial class CreateExchangeRateForCurrencyCommandHandler: CreateExchangeRateForCurrencyCommandHandlerBase +{ + public CreateExchangeRateForCurrencyCommandHandler( + CryptocashDbContext dbContext, + NoxSolution noxSolution, + IEntityFactory entityFactory, + IServiceProvider serviceProvider) + : base(dbContext, noxSolution, entityFactory, serviceProvider) + { + } +} +public abstract class CreateExchangeRateForCurrencyCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; - public CreateExchangeRateForCurrencyCommandHandler( + public CreateExchangeRateForCurrencyCommandHandlerBase( CryptocashDbContext dbContext, NoxSolution noxSolution, IEntityFactory entityFactory, @@ -34,7 +45,7 @@ public CreateExchangeRateForCurrencyCommandHandler( _entityFactory = entityFactory; } - public async Task Handle(CreateExchangeRateForCurrencyCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateExchangeRateForCurrencyCommand request, CancellationToken cancellationToken) { OnExecuting(request); var keyId = CreateNoxTypeForKey("Id", request.ParentKeyDto.keyId); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateHolidayForCountryCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateHolidayForCountryCommand.g.cs index c81ef4cfaf..940c4f1273 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateHolidayForCountryCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateHolidayForCountryCommand.g.cs @@ -19,12 +19,23 @@ namespace Cryptocash.Application.Commands; public record CreateHolidayForCountryCommand(CountryKeyDto ParentKeyDto, HolidayCreateDto EntityDto, System.Guid? Etag) : IRequest ; -public partial class CreateHolidayForCountryCommandHandler: CommandBase, IRequestHandler +public partial class CreateHolidayForCountryCommandHandler: CreateHolidayForCountryCommandHandlerBase +{ + public CreateHolidayForCountryCommandHandler( + CryptocashDbContext dbContext, + NoxSolution noxSolution, + IEntityFactory entityFactory, + IServiceProvider serviceProvider) + : base(dbContext, noxSolution, entityFactory, serviceProvider) + { + } +} +public abstract class CreateHolidayForCountryCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; - public CreateHolidayForCountryCommandHandler( + public CreateHolidayForCountryCommandHandlerBase( CryptocashDbContext dbContext, NoxSolution noxSolution, IEntityFactory entityFactory, @@ -34,7 +45,7 @@ public CreateHolidayForCountryCommandHandler( _entityFactory = entityFactory; } - public async Task Handle(CreateHolidayForCountryCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateHolidayForCountryCommand request, CancellationToken cancellationToken) { OnExecuting(request); var keyId = CreateNoxTypeForKey("Id", request.ParentKeyDto.keyId); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateLandLordCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateLandLordCommand.g.cs index 366e580a39..822976368d 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateLandLordCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateLandLordCommand.g.cs @@ -27,13 +27,14 @@ public CreateLandLordCommandHandler( NoxSolution noxSolution, IEntityFactory vendingmachinefactory, IEntityFactory entityFactory, - IServiceProvider serviceProvider): base(dbContext, noxSolution,vendingmachinefactory,entityFactory, serviceProvider) + IServiceProvider serviceProvider) + : base(dbContext, noxSolution,vendingmachinefactory,entityFactory, serviceProvider) { } } -public partial class CreateLandLordCommandHandlerBase: CommandBase, IRequestHandler +public abstract class CreateLandLordCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; @@ -51,7 +52,7 @@ public CreateLandLordCommandHandlerBase( _vendingmachinefactory = vendingmachinefactory; } - public async Task Handle(CreateLandLordCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateLandLordCommand request, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); OnExecuting(request); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateMinimumCashStockCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateMinimumCashStockCommand.g.cs index 8e9aa8fb32..ee63b493e5 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateMinimumCashStockCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateMinimumCashStockCommand.g.cs @@ -28,13 +28,14 @@ public CreateMinimumCashStockCommandHandler( IEntityFactory vendingmachinefactory, IEntityFactory currencyfactory, IEntityFactory entityFactory, - IServiceProvider serviceProvider): base(dbContext, noxSolution,vendingmachinefactory,currencyfactory,entityFactory, serviceProvider) + IServiceProvider serviceProvider) + : base(dbContext, noxSolution,vendingmachinefactory,currencyfactory,entityFactory, serviceProvider) { } } -public partial class CreateMinimumCashStockCommandHandlerBase: CommandBase, IRequestHandler +public abstract class CreateMinimumCashStockCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; @@ -55,7 +56,7 @@ public CreateMinimumCashStockCommandHandlerBase( _currencyfactory = currencyfactory; } - public async Task Handle(CreateMinimumCashStockCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateMinimumCashStockCommand request, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); OnExecuting(request); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreatePaymentDetailCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreatePaymentDetailCommand.g.cs index e00e3e18a3..5330a84daa 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreatePaymentDetailCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreatePaymentDetailCommand.g.cs @@ -28,13 +28,14 @@ public CreatePaymentDetailCommandHandler( IEntityFactory customerfactory, IEntityFactory paymentproviderfactory, IEntityFactory entityFactory, - IServiceProvider serviceProvider): base(dbContext, noxSolution,customerfactory,paymentproviderfactory,entityFactory, serviceProvider) + IServiceProvider serviceProvider) + : base(dbContext, noxSolution,customerfactory,paymentproviderfactory,entityFactory, serviceProvider) { } } -public partial class CreatePaymentDetailCommandHandlerBase: CommandBase, IRequestHandler +public abstract class CreatePaymentDetailCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; @@ -55,7 +56,7 @@ public CreatePaymentDetailCommandHandlerBase( _paymentproviderfactory = paymentproviderfactory; } - public async Task Handle(CreatePaymentDetailCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreatePaymentDetailCommand request, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); OnExecuting(request); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreatePaymentProviderCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreatePaymentProviderCommand.g.cs index 04d223abc2..8474a1184e 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreatePaymentProviderCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreatePaymentProviderCommand.g.cs @@ -27,13 +27,14 @@ public CreatePaymentProviderCommandHandler( NoxSolution noxSolution, IEntityFactory paymentdetailfactory, IEntityFactory entityFactory, - IServiceProvider serviceProvider): base(dbContext, noxSolution,paymentdetailfactory,entityFactory, serviceProvider) + IServiceProvider serviceProvider) + : base(dbContext, noxSolution,paymentdetailfactory,entityFactory, serviceProvider) { } } -public partial class CreatePaymentProviderCommandHandlerBase: CommandBase, IRequestHandler +public abstract class CreatePaymentProviderCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; @@ -51,7 +52,7 @@ public CreatePaymentProviderCommandHandlerBase( _paymentdetailfactory = paymentdetailfactory; } - public async Task Handle(CreatePaymentProviderCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreatePaymentProviderCommand request, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); OnExecuting(request); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateTransactionCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateTransactionCommand.g.cs index 1579423a1c..22e0710527 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateTransactionCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateTransactionCommand.g.cs @@ -28,13 +28,14 @@ public CreateTransactionCommandHandler( IEntityFactory customerfactory, IEntityFactory bookingfactory, IEntityFactory entityFactory, - IServiceProvider serviceProvider): base(dbContext, noxSolution,customerfactory,bookingfactory,entityFactory, serviceProvider) + IServiceProvider serviceProvider) + : base(dbContext, noxSolution,customerfactory,bookingfactory,entityFactory, serviceProvider) { } } -public partial class CreateTransactionCommandHandlerBase: CommandBase, IRequestHandler +public abstract class CreateTransactionCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; @@ -55,7 +56,7 @@ public CreateTransactionCommandHandlerBase( _bookingfactory = bookingfactory; } - public async Task Handle(CreateTransactionCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateTransactionCommand request, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); OnExecuting(request); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateVendingMachineCommand.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateVendingMachineCommand.g.cs index 580ef1d906..bac125dc4a 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateVendingMachineCommand.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Commands.CreateVendingMachineCommand.g.cs @@ -31,13 +31,14 @@ public CreateVendingMachineCommandHandler( IEntityFactory cashstockorderfactory, IEntityFactory minimumcashstockfactory, IEntityFactory entityFactory, - IServiceProvider serviceProvider): base(dbContext, noxSolution,countryfactory,landlordfactory,bookingfactory,cashstockorderfactory,minimumcashstockfactory,entityFactory, serviceProvider) + IServiceProvider serviceProvider) + : base(dbContext, noxSolution,countryfactory,landlordfactory,bookingfactory,cashstockorderfactory,minimumcashstockfactory,entityFactory, serviceProvider) { } } -public partial class CreateVendingMachineCommandHandlerBase: CommandBase, IRequestHandler +public abstract class CreateVendingMachineCommandHandlerBase: CommandBase, IRequestHandler { private readonly CryptocashDbContext _dbContext; private readonly IEntityFactory _entityFactory; @@ -67,7 +68,7 @@ public CreateVendingMachineCommandHandlerBase( _minimumcashstockfactory = minimumcashstockfactory; } - public async Task Handle(CreateVendingMachineCommand request, CancellationToken cancellationToken) + public virtual async Task Handle(CreateVendingMachineCommand request, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); OnExecuting(request); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Dto.BookingCreateDto.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Dto.BookingCreateDto.g.cs index 0eae6d7620..8e9ef49d50 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Dto.BookingCreateDto.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Dto.BookingCreateDto.g.cs @@ -23,11 +23,9 @@ public partial class BookingCreateDto: BookingCreateDtoBase /// Exchange booking and related data. /// public abstract class BookingCreateDtoBase : IEntityCreateDto -{ - /// - /// Booking unique identifier (Required). +{/// + /// Booking unique identifier (Optional). /// - [Required(ErrorMessage = "Id is required")] public System.Guid Id { get; set; } = default!; /// /// Booking's amount exchanged from (Required). diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Dto.VendingMachineCreateDto.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Dto.VendingMachineCreateDto.g.cs index 036eea1452..cffaa4582b 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Dto.VendingMachineCreateDto.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Dto.VendingMachineCreateDto.g.cs @@ -23,11 +23,9 @@ public partial class VendingMachineCreateDto: VendingMachineCreateDtoBase /// Vending machine definition and related data. /// public abstract class VendingMachineCreateDtoBase : IEntityCreateDto -{ - /// - /// Vending machine unique identifier (Required). +{/// + /// Vending machine unique identifier (Optional). /// - [Required(ErrorMessage = "Id is required")] public System.Guid Id { get; set; } = default!; /// /// Vending machine mac address (Required). diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.BankNoteFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.BankNoteFactory.g.cs index 2b5a14d251..aaa39dbce3 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.BankNoteFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.BankNoteFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.BookingFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.BookingFactory.g.cs index 0ecf84e8b7..d33f602a43 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.BookingFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.BookingFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; @@ -39,7 +40,6 @@ public virtual Booking CreateEntity(BookingCreateDto createDto) private Cryptocash.Domain.Booking ToEntity(BookingCreateDto createDto) { var entity = new Cryptocash.Domain.Booking(); - entity.Id = System.Guid.Empty.Equals(createDto.Id) ? Nox.Types.Guid.From(System.Guid.NewGuid()) : Booking.CreateId(createDto.Id); entity.AmountFrom = Cryptocash.Domain.Booking.CreateAmountFrom(createDto.AmountFrom); entity.AmountTo = Cryptocash.Domain.Booking.CreateAmountTo(createDto.AmountTo); entity.RequestedPickUpDate = Cryptocash.Domain.Booking.CreateRequestedPickUpDate(createDto.RequestedPickUpDate); @@ -47,6 +47,7 @@ private Cryptocash.Domain.Booking ToEntity(BookingCreateDto createDto) if (createDto.ExpiryDateTime is not null)entity.ExpiryDateTime = Cryptocash.Domain.Booking.CreateExpiryDateTime(createDto.ExpiryDateTime.NonNullValue()); if (createDto.CancelledDateTime is not null)entity.CancelledDateTime = Cryptocash.Domain.Booking.CreateCancelledDateTime(createDto.CancelledDateTime.NonNullValue()); if (createDto.VatNumber is not null)entity.VatNumber = Cryptocash.Domain.Booking.CreateVatNumber(createDto.VatNumber.NonNullValue()); + entity.EnsureId(createDto.Id); //entity.Customer = Customer.ToEntity(); //entity.VendingMachine = VendingMachine.ToEntity(); //entity.Commission = Commission.ToEntity(); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CashStockOrderFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CashStockOrderFactory.g.cs index 1783d8ec6d..3a7489f7f3 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CashStockOrderFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CashStockOrderFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CommissionFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CommissionFactory.g.cs index 5a3202e72e..7f8c2cd0b4 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CommissionFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CommissionFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryFactory.g.cs index c27fdc3ce3..f2e9fdd4b8 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryTimeZoneFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryTimeZoneFactory.g.cs index 6b4f3e0467..9fa66f0b18 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryTimeZoneFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryTimeZoneFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CurrencyFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CurrencyFactory.g.cs index 2fdbb6d3b9..f790a91f7d 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CurrencyFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CurrencyFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CustomerFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CustomerFactory.g.cs index 6c496ecd72..1b437b6f34 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CustomerFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CustomerFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.EmployeeFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.EmployeeFactory.g.cs index f627a52d14..57386eb6c2 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.EmployeeFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.EmployeeFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.EmployeePhoneNumberFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.EmployeePhoneNumberFactory.g.cs index bd27ec8695..ba288a20f1 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.EmployeePhoneNumberFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.EmployeePhoneNumberFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.ExchangeRateFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.ExchangeRateFactory.g.cs index 414ad1db8c..c9aa1b49fb 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.ExchangeRateFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.ExchangeRateFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.HolidayFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.HolidayFactory.g.cs index 2c2aaab335..fc5480a289 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.HolidayFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.HolidayFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.LandLordFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.LandLordFactory.g.cs index 5fa0801941..59eed8dca9 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.LandLordFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.LandLordFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.MinimumCashStockFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.MinimumCashStockFactory.g.cs index 4e88705716..27d396091e 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.MinimumCashStockFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.MinimumCashStockFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.PaymentDetailFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.PaymentDetailFactory.g.cs index 3436301492..f5ed72573f 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.PaymentDetailFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.PaymentDetailFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.PaymentProviderFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.PaymentProviderFactory.g.cs index f4fba6577e..cab2b35fe2 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.PaymentProviderFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.PaymentProviderFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.TransactionFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.TransactionFactory.g.cs index 87f3ad9a05..7b77faeca3 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.TransactionFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.TransactionFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.VendingMachineFactory.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.VendingMachineFactory.g.cs index 0b88fd7581..6479aa2dca 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.VendingMachineFactory.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.VendingMachineFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; @@ -39,7 +40,6 @@ public virtual VendingMachine CreateEntity(VendingMachineCreateDto createDto) private Cryptocash.Domain.VendingMachine ToEntity(VendingMachineCreateDto createDto) { var entity = new Cryptocash.Domain.VendingMachine(); - entity.Id = System.Guid.Empty.Equals(createDto.Id) ? Nox.Types.Guid.From(System.Guid.NewGuid()) : VendingMachine.CreateId(createDto.Id); entity.MacAddress = Cryptocash.Domain.VendingMachine.CreateMacAddress(createDto.MacAddress); entity.PublicIp = Cryptocash.Domain.VendingMachine.CreatePublicIp(createDto.PublicIp); entity.GeoLocation = Cryptocash.Domain.VendingMachine.CreateGeoLocation(createDto.GeoLocation); @@ -47,6 +47,7 @@ private Cryptocash.Domain.VendingMachine ToEntity(VendingMachineCreateDto create entity.SerialNumber = Cryptocash.Domain.VendingMachine.CreateSerialNumber(createDto.SerialNumber); if (createDto.InstallationFootPrint is not null)entity.InstallationFootPrint = Cryptocash.Domain.VendingMachine.CreateInstallationFootPrint(createDto.InstallationFootPrint.NonNullValue()); if (createDto.RentPerSquareMetre is not null)entity.RentPerSquareMetre = Cryptocash.Domain.VendingMachine.CreateRentPerSquareMetre(createDto.RentPerSquareMetre.NonNullValue()); + entity.EnsureId(createDto.Id); //entity.Country = Country.ToEntity(); //entity.LandLord = LandLord.ToEntity(); //entity.Bookings = Bookings.Select(dto => dto.ToEntity()).ToList(); diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Domain.Booking.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Domain.Booking.g.cs index 5ace660567..a363674976 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Domain.Booking.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Domain.Booking.g.cs @@ -35,7 +35,23 @@ public abstract class BookingBase : AuditableEntityBase, IEntityConcurrent /// /// Booking unique identifier (Required). /// - public Nox.Types.Guid Id { get; set; } = null!; + public Nox.Types.Guid Id {get; set;} = null!; + + public virtual void EnsureId(System.Guid guid) + { + if(System.Guid.Empty.Equals(guid)) + { + Id = Nox.Types.Guid.From(System.Guid.NewGuid()); + } + else + { + var currentGuid = Nox.Types.Guid.From(guid); + if(Id != currentGuid) + { + throw new NoxGuidTypeException("Immutable guid property Id value is different since it has been initialized"); + } + } + } /// /// Booking's amount exchanged from (Required). diff --git a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Domain.VendingMachine.g.cs b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Domain.VendingMachine.g.cs index f007d1a430..6e272defc0 100644 --- a/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Domain.VendingMachine.g.cs +++ b/samples/Cryptocash.Api/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Domain.VendingMachine.g.cs @@ -35,7 +35,23 @@ public abstract class VendingMachineBase : AuditableEntityBase, IEntityConcurren /// /// Vending machine unique identifier (Required). /// - public Nox.Types.Guid Id { get; set; } = null!; + public Nox.Types.Guid Id {get; set;} = null!; + + public virtual void EnsureId(System.Guid guid) + { + if(System.Guid.Empty.Equals(guid)) + { + Id = Nox.Types.Guid.From(System.Guid.NewGuid()); + } + else + { + var currentGuid = Nox.Types.Guid.From(guid); + if(Id != currentGuid) + { + throw new NoxGuidTypeException("Immutable guid property Id value is different since it has been initialized"); + } + } + } /// /// Vending machine mac address (Required). diff --git a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Dto.StoreCreateDto.g.cs b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Dto.StoreCreateDto.g.cs index 7e8b874be0..ede31ef639 100644 --- a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Dto.StoreCreateDto.g.cs +++ b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Dto.StoreCreateDto.g.cs @@ -23,11 +23,9 @@ public partial class StoreCreateDto: StoreCreateDtoBase /// Stores. /// public abstract class StoreCreateDtoBase : IEntityCreateDto -{ - /// - /// (Required). +{/// + /// (Optional). /// - [Required(ErrorMessage = "Id is required")] public System.Guid Id { get; set; } = default!; /// /// Store Name (Required). diff --git a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryBarCodeFactory.g.cs b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryBarCodeFactory.g.cs index 750ce03494..33f3015e15 100644 --- a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryBarCodeFactory.g.cs +++ b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryBarCodeFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryFactory.g.cs b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryFactory.g.cs index bb4147c412..c26a96b2f9 100644 --- a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryFactory.g.cs +++ b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryLocalNameFactory.g.cs b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryLocalNameFactory.g.cs index 920d2eb4c7..7f6a85804f 100644 --- a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryLocalNameFactory.g.cs +++ b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.CountryLocalNameFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.EmailAddressFactory.g.cs b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.EmailAddressFactory.g.cs index e052240d3a..46b92b5a4b 100644 --- a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.EmailAddressFactory.g.cs +++ b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.EmailAddressFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.StoreFactory.g.cs b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.StoreFactory.g.cs index 0f956a5178..2113c30376 100644 --- a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.StoreFactory.g.cs +++ b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.StoreFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; @@ -42,10 +43,10 @@ public virtual Store CreateEntity(StoreCreateDto createDto) private ClientApi.Domain.Store ToEntity(StoreCreateDto createDto) { var entity = new ClientApi.Domain.Store(); - entity.Id = System.Guid.Empty.Equals(createDto.Id) ? Nox.Types.Guid.From(System.Guid.NewGuid()) : Store.CreateId(createDto.Id); entity.Name = ClientApi.Domain.Store.CreateName(createDto.Name); entity.Address = ClientApi.Domain.Store.CreateAddress(createDto.Address); entity.Location = ClientApi.Domain.Store.CreateLocation(createDto.Location); + entity.EnsureId(createDto.Id); //entity.StoreOwner = StoreOwner?.ToEntity(); if (createDto.VerifiedEmails is not null) { diff --git a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.StoreOwnerFactory.g.cs b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.StoreOwnerFactory.g.cs index c70ed1729a..8a770f10fd 100644 --- a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.StoreOwnerFactory.g.cs +++ b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.StoreOwnerFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; diff --git a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.WorkplaceFactory.g.cs b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.WorkplaceFactory.g.cs index e65f6d6023..a64c941671 100644 --- a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.WorkplaceFactory.g.cs +++ b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Application.Factories.WorkplaceFactory.g.cs @@ -1,7 +1,8 @@ -using System;// Generated +// Generated #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; @@ -39,8 +40,8 @@ public virtual Workplace CreateEntity(WorkplaceCreateDto createDto) private ClientApi.Domain.Workplace ToEntity(WorkplaceCreateDto createDto) { var entity = new ClientApi.Domain.Workplace(); - entity.EnsureId(); entity.Name = ClientApi.Domain.Workplace.CreateName(createDto.Name); + entity.EnsureId(); //entity.Country = Country?.ToEntity(); return entity; } diff --git a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Domain.Store.g.cs b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Domain.Store.g.cs index 58f6af54de..3ffddec85a 100644 --- a/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Domain.Store.g.cs +++ b/src/Nox.ClientApi.Tests/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Domain.Store.g.cs @@ -35,7 +35,23 @@ public abstract class StoreBase : AuditableEntityBase, IEntityConcurrent /// /// (Required). /// - public Nox.Types.Guid Id { get; set; } = null!; + public Nox.Types.Guid Id {get; set;} = null!; + + public virtual void EnsureId(System.Guid guid) + { + if(System.Guid.Empty.Equals(guid)) + { + Id = Nox.Types.Guid.From(System.Guid.NewGuid()); + } + else + { + var currentGuid = Nox.Types.Guid.From(guid); + if(Id != currentGuid) + { + throw new NoxGuidTypeException("Immutable guid property Id value is different since it has been initialized"); + } + } + } /// /// Store Name (Required). diff --git a/src/Nox.Generator/Application/Dto/EntityCreateDto.template.cs b/src/Nox.Generator/Application/Dto/EntityCreateDto.template.cs index 1ab8884395..529b165ba0 100644 --- a/src/Nox.Generator/Application/Dto/EntityCreateDto.template.cs +++ b/src/Nox.Generator/Application/Dto/EntityCreateDto.template.cs @@ -29,10 +29,12 @@ public abstract class {{className}}Base : IEntityCreateDto<{{entity.Name}}> {{ continue; -}} {{- end }} {{- if key.Type == "Guid" -}} + /// /// {{key.Description}} (Optional). /// {{- else }} + /// /// {{key.Description}} (Required). /// diff --git a/src/Nox.Generator/Application/Factories/EntityFactory.template.cs b/src/Nox.Generator/Application/Factories/EntityFactory.template.cs index 84857b846b..216e8c6d70 100644 --- a/src/Nox.Generator/Application/Factories/EntityFactory.template.cs +++ b/src/Nox.Generator/Application/Factories/EntityFactory.template.cs @@ -1,5 +1,3 @@ -using System; - {{- ownedEntities = entity.OwnedRelationships | array.map "Entity" }} {{- func fieldFactoryName ret (string.downcase $0 + "Factory") @@ -8,6 +6,7 @@ #nullable enable +using System; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.EntityFrameworkCore; @@ -60,14 +59,6 @@ public abstract class {{className}}Base: IEntityFactory<{{entity.Name}},{{entity {{- end }} entity.{{key.Name}} = {{ entity.Name }}.Create{{key.Name}}(createDto.{{key.Name}}); {{- end }} - {{- for key in entity.Keys ~}} - {{- if key.Type == "Nuid" }} - entity.Ensure{{key.Name}}(); - {{- end }} - {{- if key.Type == "Guid" }} - entity.{{key.Name}} = System.Guid.Empty.Equals(createDto.{{key.Name}}) ? Nox.Types.Guid.From(System.Guid.NewGuid()) : {{ entity.Name }}.Create{{key.Name}}(createDto.{{key.Name}}); - {{- end }} - {{- end }} {{- for attribute in entity.Attributes }} {{- if !IsNoxTypeReadable attribute.Type || attribute.Type == "Formula" -}} {{ continue; }} @@ -84,6 +75,15 @@ public abstract class {{className}}Base: IEntityFactory<{{entity.Name}},{{entity {{- end }} {{- end }} + {{- for key in entity.Keys ~}} + {{- if key.Type == "Nuid" }} + entity.Ensure{{key.Name}}(); + {{- end }} + {{- if key.Type == "Guid" }} + entity.Ensure{{key.Name}}(createDto.{{key.Name}}); + {{- end }} + {{- end }} + {{- for relationship in entity.Relationships }} {{- if relationship.Relationship == "ZeroOrMany" || relationship.Relationship == "OneOrMany"}} //entity.{{relationship.EntityPlural}} = {{relationship.EntityPlural}}.Select(dto => dto.ToEntity()).ToList();