27 lines
408 B
C#
27 lines
408 B
C#
|
using System;
|
||
|
|
||
|
namespace ZC;
|
||
|
|
||
|
public interface IPerson
|
||
|
{
|
||
|
string name { get; }
|
||
|
int age { get; }
|
||
|
}
|
||
|
|
||
|
file class Person : IPerson
|
||
|
{
|
||
|
public string name { get; set; }
|
||
|
public int age { get; set; }
|
||
|
}
|
||
|
|
||
|
public class PersonManager
|
||
|
{
|
||
|
public static IPerson CreatePerson(string name, int age)
|
||
|
{
|
||
|
return new Person
|
||
|
{
|
||
|
name = name,
|
||
|
age = age
|
||
|
};
|
||
|
}
|
||
|
}
|