none
Entity Model RRS feed

Answers

All replies

  • There is no rule that if you are using EF, you can't use ADO.NET directly to work with database. But why do you want to do that? Everything is already in place which you can make use of. EF is best optimized and you can use EF only to insert data into table.
    Please mark this post as answer if it solved your problem. Happy Programming!
    Saturday, September 10, 2011 12:55 PM
  • Hello,

    You can use ObjectContext.AddObject to add this object into ObjectContext, and call SaveChanges method to storage this record onto database side. For your reference, check it here. http://msdn.microsoft.com/en-us/library/system.data.objects.objectcontext.addobject.aspx 

    Based on my experience, I suggest you use local context instance in your project, not a global one.

    Hope this helps.

    Thanks,


    Larcolais Gong[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Tuesday, September 13, 2011 1:56 PM
  • You can create a Entity Factory class that creates the default objects for you. This way you only have to write them ones.

    Hope this helps

    grtz

    Tuesday, September 13, 2011 7:23 PM