【发布时间】:2012-01-25 11:55:08
【问题描述】:
这如何作为 WCF 服务工作?
public class BusinessObject<T> where T : IEntity
{
public T Entity { get; set; }
public BusinessObject(T entity)
{
this.Entity = entity;
}
}
public interface IEntity { }
public class Student : IEntity
{
public int StudentID { get; set; }
public string Name { get; set; }
}
我想在 WCF 服务中公开 BusinessObject
我的代码在 C#、.NET Framework 4.0 中,在 Visual Studio 2010 Pro 中构建。
【问题讨论】: