Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6129971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:48:15+00:00 2026-05-23T16:48:15+00:00

I crate domain project to store dbml file and several domain classes. I create

  • 0

I crate domain project to store dbml file and several domain classes. I create unit test project to test CRUD operation. I reference domain project to the test project.

I declare the db context in the unit test, in the test method I try to access method db.SubmitChanges(); but It is not accessible.

But when the unit test file stored in the domain project, the db method is accessible.

[TestFixture]
class CustomerRepositoryTest
{
    NorthWindDataContext db = new NorthWindDataContext();
    Customer _customer = null;

    [SetUp]
    public void SetUp() {
        //initialize customer
    }

    [Test]
    public void Should_able_to_get_data_when_data_is_inserted()
    {
        db.Customers.InsertOnSubmit(_customer);
        db.SubmitChanges();

        Customer customer = db.Customers.FirstOrDefault(c => c.CustomerID == _customer.CustomerID);

        Assert.AreEqual(customer.CustomerID.Trim(), _customer.CustomerID);
        Assert.AreEqual(customer.ContactName.Trim(), _customer.ContactName);
    }

    [TearDown]
    public void After()
    {
        db.Customers.DeleteOnSubmit(_customer);
        db.SubmitChanges();
    }
}

Let me know how to fix this.

EDIT:

Error   1   'AppProject.Domain.NorthWindDataContext' does not contain a definition for 'SubmitChanges' and no extension method 'SubmitChanges' accepting a first argument of type 'AppProject.Domain.NorthWindDataContext' could be found (are you missing a using directive or an assembly reference?) D:\tutorial\dotNET\LINQtoSQL\AppProject.Spec\Should_insert_customer.cs  40  16  AppProject.Spec
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:48:16+00:00Added an answer on May 23, 2026 at 4:48 pm

    You need to add reference to System.Data.Linq assembly in your test project.
    The assembly reference is added to your main project when creating dbml file (data context). in order to use all of the LinqToSQL functionality, you need to reference System.Data.Linq in all of the projects where DataContext is used.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using NHibernate and Fluent NHibernate to create a mapping file for a domain
Hallo all. i want to create a .htaccess file if i type subdomain.domain.com can
I used maven-glassfish-plugin create a new domain but file isn't existed master-password? Why? Command
Here goes a newbie question: Create a new project in Xcode: File > New
UPDATE 3: I created a Visual Studio 2008 test project and tried to create
I don't want to store my domain model classes in the same assembly as
I need to create multi domain for my Zend project but I dont know
I would like to create a WLST script to create my Weblogic domain. However
I need to create a custom application domain to work around a bug in
I am trying to create a validation that checks to make sure a domain/url

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.