如何在WCF C#中获取对集合的引用?

如何在WCF C#中获取对集合的引用?,c#,wcf,C#,Wcf,我在一个解决方案中有两个WCF服务: Wcf.BLL Wcf.model 我有一个额外的类注册列表正在使用Wcf.model,代码如下: namespace Wcf.model { class RegistrationList { [Required] public string Login { get; set; } [Required] publ

我在一个解决方案中有两个WCF服务:

  • Wcf.BLL
  • Wcf.model
我有一个额外的类
注册列表
正在使用
Wcf.model
,代码如下:

 namespace Wcf.model
    {
        class RegistrationList
        {

            [Required]

            public string Login { get; set; }

            [Required]
            public string Password { get; set; }

        }
    }
如何从第一个服务的
Wcf.BLL
ServiceContract
访问
RegistrationList
,以设置类型为
RegistrationList
的参数

[ServiceContract]
    public interface IWcf.BLL
    {

        [OperationContract]
        string Register(RegistrationList Login); // Here I can set type as `RegistrationList`

    }

您没有为
注册列表
类指定任何访问修饰符。默认值为
internal
,因此它仅在
Wcf.model
assembly中可用

如果要在另一个程序集中使用
注册列表
,请将其设置为
公共

public class RegistrationList
{
   //...
}

你能试着提高你问题的质量吗?你想做什么和不想做什么都不太清楚。有问题的地方做了一些修改,希望更清楚。你已经在Wcf.BLL中添加了对Wcf.Model的项目引用了吗?是的,但是在
Wcf.Model
中我有单独的类(文件)
注册列表
如果您想将其保留为内部,也可以添加InternalsVisibleTo。这对我没有帮助。我没有在
Wcf.model
中看到class
RegistrationList
方法,但我确实请求在Wcf服务中分离class,可能是因为这个原因吗?@Ahmed确保您在
Wcf.BLL
中添加了对
Wcf.model
项目的引用