I have done all the steps they have mentioned in the following link. "https://docs.aspnetzero.com/documents/zero/latest/Developing-Step-By-Step-Angular#using-getpeople-method-from-angular-component"
But i have changed the table names and variable only. Everything is mapped correctly based on document.
public ListResultDto<SectionsListDto> GetSections(GetSectionsInput input)
{
var sections = _sectionRepository
.GetAll()
.WhereIf(
!input.Filter.IsNullOrEmpty(),
p => p.rec_id.Contains(input.Filter) ||
p.s_text.Contains(input.Filter) ||
p.t_text.Contains(input.Filter)
)
.OrderBy(p => p.rec_id)
.ThenBy(p => p.s_text)
.ToList();
return new ListResultDto<SectionsListDto>(ObjectMapper.Map<List<SectionsListDto>>(sections));
}
Mark the breakpoint in VS in above method. But didn't get any data from database.
16 Answer(s)
-
0
Hi @kalidarscope
Are you getting an error or just an empty result ?
Thanks,
-
0
Getting empty result. But i have 2 records in database. Tested the connection string also. Everything is fine.
-
0
Check the value of
AbpSession.TenantId
. -
0
I am getting 1 in
AbpSession.TenantId
. -
0
Check the
TenantId
of the records. -
0
-
0
i think @aaron was refering to the 2 records in your database. Does the 2 records have TenantId = 1 as well?
-
0
I didn't have a TenantId column in my table. Is it must to have?
-
0
TenantId is not a mandatory field. It is totally fine without it on an entity.
can you check if the 2 records have
IsDeleted=true
? -
0
IsDeleted = 1 in my database.
-
1
this mean that the 2 records are soft deleted. Hence by default repository will not retrieve soft deleted records.
see https://aspnetboilerplate.com/Pages/Documents/Data-Filters
-
0
But i have followed steps mentioned in the document 'https://docs.aspnetzero.com/documents/zero/latest/Developing-Step-By-Step-Angular'. They get the result properly then why i couldn't get it?
-
0
Which section shows deleted records?
-
0
Sorry, I have used insert query to insert a record in table. While i was inserting, i have marked the IsDeleted = True.
As you mentioned before i have used
using (_unitOfWorkManager.Current.DisableFilter(AbpDataFilters.SoftDelete))
. Then i got the records.After that i have updated the IsDeleted = False and removed the
using (_unitOfWorkManager.Current.DisableFilter(AbpDataFilters.SoftDelete))
. But didn't get the data. -
0
Is it still
IsDeleted = 1
in your database? -
0
Sorry it was my mistake. Thank you so much @aaron.