开发者

Property changing null whilst updating a value

i am 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 anonoymous type has been converted into strong object type. This strong type is updated again.


Can anyone explain the reason for this?

Sample Code:

var questions = from Question in _db.QuestionDataSourc开发者_StackOverflow中文版e
                            join AnswerType in _db.AnswerTypeDataSource on Question.IN_AnswerTypeId equals AnswerType.IN_AnswerTypeId
                            join Section in _db.SectionDataSource on 
........
                            orderby Section.IN_Order,Question.VC_Code  

                            select new
                            {
                                Question.UI_QuestionID,
                                Question.VC_Description,

                            }; 

----------

ICollection<ICheckListInstanceQuestion> checkListQuestions = new 
List<ICheckListInstanceQuestion>();
        foreach (var question in questions)
        {
            checkListQuestions.Add(new CheckListInstanceQuestion
            {

                UI_QuestionID = question.UI_QuestionID,

                VC_Description = question.VC_Description,



            });


The solution is

the object which created is localized one and it  needs to be attached into original object.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜