When mapping to CityWithNavigationPropertiesDto
, it worked. Also using AsNoTracking
prevented changing. Thanks for reply.
hi
We tried your method but it did not work. We also tried AsnoTracking
method. It worked.
As you see previous code block, we make just get process. So even if ef core tracks the entities, it should not change database value. Why database updates occur?
To prevent data corruption should we always use AsNoTracking
method while getting list? is there any performance effect using AsNoTracking
on project.
On appservice we are getting data as list. After getting list, we change property value using for loop. We get successfully excepted result on UI and in list. Additionally row that related that data at sql also changes.
public virtual async Task<PagedResultDto<CityWithNavigationPropertiesDto>> GetListAsync(GetCitiesInput input)
{
var totalCount = await _cityRepository.GetCountAsync(input.FilterText, input.Name, input.IsActive, input.CountryId);
var items = await _cityRepository.GetListWithNavigationPropertiesAsync(input.FilterText, input.Name, input.IsActive, input.CountryId, input.Sorting, input.MaxResultCount, input.SkipCount);
var tmp = items.FirstOrDefault();
tmp.City.Name = "newValue";
return new PagedResultDto<CityWithNavigationPropertiesDto>
{
TotalCount = totalCount,
Items = ObjectMapper.Map<List<CityWithNavigationProperties>, List<CityWithNavigationPropertiesDto>>(items)
};
}
For test purposes, as you see above code we assing 'newValue' first item of list. It is okey, it changes. But it also changes database row of it. We also disable UOW, but result is same. On appservice we just get list , not create or update entity, despite this it updates value.
--------------------------------------------------------------------------------------------- By the way, we renewed our license but our ticket count did not renew to 30.
When we manually delete cookies for this question;
What can be done about this?
Hi We have created new project using suite in order to share with you. We set database name different name than project name. This time it worked. Also we set new database one of servers for released project that we are getting error. This new database name is also different than projectname. If project name is "ProjectX" , we have set database name as "ProjectXDB". It also worked. We could not get it how it worked. Now project can work with database name as same project name and different form project name. While we are working on this issue, i have new issue to ask you. If you do not mind we want to ask it on this ticket. We get Invalid token message when try reset password. We use reset password page of abp so you and other services of abp like GenerateResetPasswordToken etc. This method generate token there isn't problem but i get invalid token message when use token to reset password via generated link. And we tried other way direct via endpoint which called "change-password" with token which take from auth server with client_id and secret. But i get 401 error (Token hasn't audience claim) when i put to endpoint. By the way we try access endpoint in same program(No Tiered; Blazor and Auth same). So how can i solve this problems? We tried disable valid audience but don't work. We are waiting your help and supports.
Hi Yes they are using separate Redis.
Hi There are two servers and two mssql dbs. And there is also two same release app. We want to deploy them on separate servers. We deployed first released app with database which has same name as project name. It properyl works. In other hand, we tried to use second release app with database which has different name than project name. It throw error.
Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name projectName.dbo.tableName
I think, it tries to find table on database with name same as project name. We set database names in appsettings.json for each server.
We have released app named "projectNameX". Then placed it on two different server for release and test stage. They have different database names like "projectNameX_Dev" and "projectNameX_Test". We have issue on "projectNameX_Test" and "projectNameX_Dev" database connection. Even if we set connection string as "projectNameX_Test' and "projectNameX_Dev" , requests are used "projectNameX.dbo.tableName". We are getting below error. Table can not be found.
Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name projectNameX.dbo.tableName
Otherwise we change connection string to "projectName", it works.
Is there any way to set desired database name?
We found an IIS config option that makes our problem temporarily solved.
This is IIS webconfig. When hosting model is inprocess, we can not get successfully response over demo client. But when we change it to outofprocess it works. On outofprocess option IIS gives low performance. We want to run release on IIS with hostingmodel is inprocess.