Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "aescg1220"

@SDU, it shouldn't, and didn't for me. Per the documentation on the downloads page:

Project name is unique for counting down your project generation allowances. Every different project name is meant to be a new project and decreases your project generation right by one. You can enter the same project name to download a project multiple times without affecting your limits (even with different technology options).

Same issue here. Downloaded the latest version v11.0 (of a 10.0.0.0 project) yesterday and it still has references to net5.0. Also attempted again about 5 minutes ago and it's still targeting net5.0. One example is MyProjectName.Application.csproj

Also, on the downloads page, it still lists .NET 5.0 as the Framework:

Got it figured out... Simply wrap the code in WithUnitOfWork/WithUnitOfWorkAsync

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? 10.0.0
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .net core

If issue related with ABP Framework

  • What is ABP Framework version? 6.0.0

Issue

I have 2 entities in my model

Now i've added a test using repositories:

Unfortunately the test fails on line 27, due to the fact that it tries to recreate the SimpleEntity (with the same Id). var barId = await bars.InsertAndGetIdAsync(new Bar() { Name = "Bar1", SimpleEntity = simpleEntity });

Should we be able to set the navigation property when using repositories? Is this a limitation of IRepository usage in Tests?

Notes

Setting the navigation property works when using the UsingDbContext method Setting the SimpleEntityId property works when using repositories Creating the simpleentity inline works when using repositories (e.g. var barId = await bars.InsertAndGetIdAsync(new Bar() { Name = "Bar1", SimpleEntity = new SimpleEntity() { Name = "Simple1" } });)

Exception

Source: BarTests.cs line 19 Duration: 5.6 sec

Message: Microsoft.EntityFrameworkCore.DbUpdateException : An error occurred while updating the entries. See the inner exception for details. ---- Microsoft.Data.Sqlite.SqliteException : SQLite Error 19: 'UNIQUE constraint failed: SimpleEntities.Id'. Stack Trace: ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) BatchExecutor.ExecuteAsync(IEnumerable1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) BatchExecutor.ExecuteAsync(IEnumerable1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) BatchExecutor.ExecuteAsync(IEnumerable1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) StateManager.SaveChangesAsync(IList1 entriesToSave, CancellationToken cancellationToken) StateManager.SaveChangesAsync(DbContext _, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) AbpDbContext.SaveChangesAsync(CancellationToken cancellationToken) AbpZeroCommonDbContext3.SaveChangesAsync(CancellationToken cancellationToken) EfCoreRepositoryBase3.InsertAndGetIdAsync(TEntity entity) UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) BarTests.CanSetDependenciesSeparately() line 27 --- End of stack trace from previous location --- ----- Inner Stack Trace ----- SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db) SqliteDataReader.NextResult() SqliteCommand.ExecuteReader(CommandBehavior behavior) SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)

Showing 1 to 4 of 4 entries