c# - Handling errors during Entity Framework database operations -


i want handle errors such foreign-key violations during entity framework database operations. so, when user updates, inserts, or deletes record using framework, want catch sql errors , show them cleaner, readable error message. currently, without error handling, application left in broken state , error message pops long, specific stacktrace.

i have had trouble finding clean solution problem. appreciated!

also, i'm using entity framework, in combination silverlight , wcf data services.

the common solution write try/catch in code. or use generic repository pattern suggested in following link -

http://social.msdn.microsoft.com/forums/en-us/bf1f6e46-28d8-427f-a259-00f85b403238/entity-framework-centralized-exception-handling


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -