vs2010 Linq to SQL -- adding an entity from my DBML
Posted
by Matt
on Stack Overflow
See other posts from Stack Overflow
or by Matt
Published on 2009-12-26T08:02:19Z
Indexed on
2010/05/31
4:32 UTC
Read the original article
Hit count: 800
linq-to-sql
|visual-studio-2010-beta-2
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. :-)
© Stack Overflow or respective owner