Property changing null whilst updating a value.

Posted by dinesh on Stack Overflow See other posts from Stack Overflow or by dinesh
Published on 2010-04-30T15:36:52Z Indexed on 2010/04/30 15:47 UTC
Read the original article Hit count: 202

Filed under:

retreiveing the Data object through a class which is partial class in linq to sql.

i am using the same object model to update the changes. but proprertychanging is always null for this object.

An anonoymoustype has been converted into strong object type. This strong type is updated again.

    any one can expalin reason for this?

Sample Code:

 var questions = from Question in _db.CheckListInstanceQuestionDataSource
                        join Question in _db.QuestionDataSource on CheckListInstanceQuestion.UI_QuestionID equals Question.UI_QuestionID

                        where CheckListInstanceQuestion.UI_CheckListInstanceID == instanceID && CheckListInstanceForm.UI_TemplateCheckListFormID == selectedFormID
                        orderby CheckListInstanceQuestion.IN_Order, CheckListInstanceQuestion.VC_Code

                        select new
                        {
                            Question .UI_QuestionID,
                            Question.VC_Description,


                        };

ICollection checkListQuestions = new List();

        foreach (var question in questions)
        {
            checkListQuestions.Add(new CheckListInstanceQuestion
            {

                UI_QuestionID = question.UI_QuestionID,

                VC_Description = question.VC_Description,



            });

© Stack Overflow or respective owner

Related posts about linq-to-sql