문제

I think I may be going crazy here...

Anyways, I have a DBML with a table 'User' in it. Pretty simple stuff -- From within a class, I have the following:

BusinessDataContext businessDataContext = new BusinessDataContext();

var user = new User();
user.FirstName = FirstName;
user.LastName = LastName;
user.MiddleInitial = MiddleInitial;
user.DateCreated = DateTime.UtcNow;

/*
  There's no businessDataContext.User.Add method -- 
  There's a bunch of generic collection methods with the <> symbols 
  (Aggregate, All, Any...)
  Am I just too tired and missing something basic 
  or did something simple change with vs 2010?
*/

businessDataContext.SubmitChanges();

I think I really just need sleep. :-)

도움이 되었습니까?

해결책

InsertOnSubmit? i.e. businessDataContext.User.InsertOnSubmit(user); or businessDataContext.Users.InsertOnSubmit(user);?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top