分离POCO类后,无法从BLL引用DAL项目

时间:2015-11-16 12:53:38

标签: c# entity-framework assembly-references

除了我的Web应用程序项目,我的解决方案中还有BLL和DAL项目。我正在使用实体框架5,我在DAL项目中有.tt文件。一切都运行正常,但后来我尝试将.tt文件分成基于this链接的新项目“实体”。

实体和DAL项目构建良好。但是对于我的BLL中具有“使用DAL”的所有类,我有一个新错误“无法找到类型或命名空间DAL”。我尝试清理所有解决方案并按顺序重建它们,我也尝试从BLL项目中删除DAL引用并读取它但仍然是同样的错误。

可能导致此问题的原因是什么?我可以添加哪些更多信息来帮助找出问题所在?

enter image description here

编辑:

以下是生成的POCO类的示例

//------------------------------------------------------------------------------
// <auto-generated>
//    This code was generated from a template.
//
//    Manual changes to this file may cause unexpected behavior in your application.
//    Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Entities
{
    using System;
    using System.Collections.Generic;

    public partial class tblsource_type
    {
        public tblsource_type()
        {
            this.tbltitles = new HashSet<tbltitle>();
        }

        public int Source_Type_Id { get; set; }
        public string Source_Type_Name { get; set; }

        public virtual ICollection<tbltitle> tbltitles { get; set; }
    }
}

1 个答案:

答案 0 :(得分:1)

您似乎不再需要using DAL;语句,因为该命名空间上没有任何内容。只需将其移除即可。

相关问题