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

Activities of "manojreddy"

Solved the issue, posting SO link so that it can help others.

[https://stackoverflow.com/a/48749913/6527049])

Which project version shall I download from [https://aspnetzero.com/Download])?

How can I check my existing project version?

@alper thanks for your quick reply.

How to disable SoftDelete at Entity level?

Which version shall I upgrade to for audit/history table?

@Aaron,

Thanks for your help always.

I have tried the steps provided by you, Its working fine for Insert records. But it's giving error while updating and deleting records.

ERROR 2018-02-12 06:13:23,049 [30 ] Mvc.ExceptionHandling.AbpExceptionFilter - An error occurred while updating the entries. See the inner exception for details. Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Cannot update identity column 'Id'.

public async Task UpdateTest()
{
	var entity = GetAll().Where(x => x.TestId == "One").FirstOrDefault();
	await UpdateAsync(entity);
}

public async Task DeleteTest()
{
	await DeleteAsync(x => x.TestId == "One"); 
}

public class Test : FullAuditedEntity
{
	// PK
	public string TestId { get; set; }

	// Unique constraint
	public int TestId2 { get; set; }
}

public class TestRepository : MyCompanyRepositoryBase<Test, int>, ITestRepository
{
	private readonly IActiveTransactionProvider _transactionProvider;

	public TestRepository(IDbContextProvider<MyCompanyDbContext> dbContextProvider,
		IObjectMapper objectMapper)
	: base(dbContextProvider, objectMapper)
	{
	}

	public TestRepository(IDbContextProvider<MyCompanyDbContext> dbContextProvider, IActiveTransactionProvider transactionProvider,
		IObjectMapper objectMapper)
	: base(dbContextProvider, objectMapper)
	{
		_transactionProvider = transactionProvider;
	}

	public async Task CreateTest()
	{

		await InsertAsync(new Test
		{
			TestId = "One",
			TestId2 = 1
		});

	}

	public async Task DeleteTest()
	{
		await DeleteAsync(x => x.TestId == "One"); 
	}

	public Task GetSearchTest()
	{
		throw new NotImplementedException();
	}

	public Test GetTest()
	{
		throw new NotImplementedException();
	}

	public Test GetTestDetailsforEdit()
	{
		return GetAll().Where(x => x.TestId == "One").FirstOrDefault();
	}

	public async Task UpdateTest()
	{
		var entity = GetAll().Where(x => x.TestId == "One").FirstOrDefault();
		await UpdateAsync(entity);
	}
}

SO again I’ll ask the sameness question.

Test cases which are there in the downloaded project are unit tests or integration tests? And why?

MY question is still unanswered.

@BBakerMMC and @strix20

So what do you suggest?

Could you please explain with some code example or sample.

Awesome, Thanks a lot

create an empty migration, then copy the "Up" and "Down" in the 56th migration into the opposite ("Down" and "Up") of the new migration

Thanks for this tip, You rock

So can I implement from FullAuditedEntity instead of Entity?

@Aaron,

You are implementing from Entity not from FullAuditedEntity. So any disadvantage or side effect of not using FullAuditedEntity.

What about CreatorUserId, CreationTime, ModificationTime, DeletionTime, DeleterUserId and SoftDelete functionality? I want all these features.

Showing 41 to 50 of 199 entries