DCSIMG
C# 3.5 - Justin myJustin = new Justin( Expriences.Current );

Browse by Tags

All Tags » C# 3.5 (RSS)

Question from Tapuz .Net forum: Linq to SQL OnValidate partial method doesn't fire

שאלה: יצרתי partial class עם שם הטבלה שלי, product במקרה זה, ואז implements the OnValidate() partial method ושם כתבתי את החוקים שלי לפי הצורך. שמתי BreakPoint בתוך OnValidate ואני רואה שהיא לא נפגעת. כלומר, בזמן שמירה של השורה, המתודה שלי לא נקראת, ולכן כל העסק לא עובד. האם יש איזה רעיון למה? public partial class Product { public void OnValidate() { if (( this .Discontinued == true ) && ( this .UnitsOnOrder > 0)) { throw new ArgumentException ( "Reorder level cannot be greater then...