0

I'm using VS2010 with Entity Framework (file version is 4.4. product version is 5)

I have installed the EF5.x DbContext generator.

After creating my .edmx file, I right clicked on the empty space and added a new DbContext template, which generated the context.tt and .tt files.

However, in the .tt files, this is how the auto generated code looks like:

namespace DataObjects.EntityFramework.Models
{
    using System;
    using System.Collections.Generic;

    public partial class SubSystem
    {
        public string SubSystemId { get; set; }
        public string Description { get; set; }
        public string Fmode { get; set; }
        public Nullable<System.DateTime> LastBackup { get; set; }
    }
}

The problem is that the using statements are inside the namespace, which gives rise to a compilation error.

0

1 Answer 1

2

Those compilation errors must be related to something else, because it's perfectly legal in C# to have using statements in the namespace.

Verify that you've added all of the correct references, such as EntityFramework.dll

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.