Base solution for your next web application

Activities of "PhilWynn"

Answer

Many thanks, that is probably the issue I am having.

The (best) solution to this problem is to set the Row Version in the Original Values collection prior to update. I will therefore need to override the update method. I assume the way to do this is via a custom repository?

If so, how do I get the framework to call this rather than the default Update method? If I call it manually, how do I ensure that the default Update method doesn't get called by the Unit Of Work manager?

Cheers

Answer

Hi,

Basically, I am not getting a DbUpdateConcurrencyException when I perform a second update on stale data. I have checked that the row version updates in the database, but EF does not object to performing the second update with the old row version.

Question

Hi,

I am attempting to implement optimistic locking in order to handle concurrency issues.

I have added the following field to my entities:

[Timestamp]
public byte[] RowVersion { get; set; }

According to the EF documentation, this is all that is required, as long as the initial row version value is supplied with the update. However, I cannot seem to get this to work in ASPNet Zero.

Should I be implementing a custom repository to perform the updates? And if so, how do I prevent the update that is automatically called by the Unit Of Work manager?

Thank you

Answer

Apologies for the delayed response, I have been away in the sun for a week.

Thanks for that. Any reason why client cache is disabled by default in the system?

Regards

Answer

Hi,

I am definitely not setting "disable cache" as the attached image will show. I get similar results when running locally or hosted on Azure.

Question

Hi,

I am currently on v4.0 of ASPNET Zero using MVC jQuery. Having experienced some performance issues I have discovered that the bundles generated by the system are not being cached on the client. All bundle headers (along with other static content) seem to be setting Cache-Control to "no-cache".

I have spent some time trying to determine why this is the case, but have not been able to find the cause.

When I create and run a Demo from your site (I assume this is running v4.2 with Angular) I see that bundles are caching as expected.

Please advise. Regards

Thank you.

I have another related issue. I am using the method you propose to save data against a user session. The problem I am now getting is that many of my unit tests, that rely on this data, are now failing. How can I inject this new session data into the unit tests?

Many thanks

Apologies, but I have just realised that the example given is for Core. Would you please be able to give an example of how this could be achieved in MVC5.

Thank you.

Thank you.

Hi,

I need to add a custom claim on login. All example code I have seen assumes that we extend AccountController.SignInAsync in order to do this. However, the current version now uses SignInManager.SignInOrTwoFactor.

Could you please tell me how I can now insert a custom claim on login.

Thank you.

Showing 81 to 90 of 111 entries