本文介绍了这个协会ORM怎么样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public class Employee
{
    public byte ID { get; set; }
    public string Name { get; set; }
}
public class Task
{
    public int ID { get; set; }
    public string Description { get; set; }


    private  List<Employee> employeeTask ;
    public  List<Employee> EmployeeTask
    {
            get
            {
                if (employeeTask == null)
                {
                    employeeTask = //Any Source changeable ;
                }
                return employeeTask;
            }
    }
}
class Program
{
    void main()
    {
         List<Task> ListTask = //fill with groub of Tasks;
                               /*When Call
                               property EmployeeTask in every Object in list (ListTask),
                               the property(EmployeeTask) in all Object
                               have the Same content (have last content element)*/
     }
}



如何在ListTask中创建每个对象拥有自己的内容(属性EmployeeTask)??


How i can make every object in ListTask have Content of its own( property EmployeeTask )??

推荐答案


这篇关于这个协会ORM怎么样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 06:38