public class PersonEntity : IEntityBase { public string Name { get; set; } public DateTime Birthdate { get; set; } public Type GetEntityType() { return this.GetType(); } } // example usage: PersonEntity person = new PersonEntity(); Type personType = person.GetEntityType(); Console.WriteLine(personType.Name); // outputs "PersonEntity"
public class AnimalEntity : IEntityBase { public string Species { get; set; } public int Age { get; set; } public Type GetEntityType() { return this.GetType(); } } // example usage: AnimalEntity dog = new AnimalEntity() { Species = "Dog", Age = 5 }; AnimalEntity cat = new AnimalEntity() { Species = "Cat", Age = 3 }; Type dogType = dog.GetEntityType(); Type catType = cat.GetEntityType(); Console.WriteLine(dogType.Name); // outputs "AnimalEntity" Console.WriteLine(catType.Name); // outputs "AnimalEntity"In this example, the AnimalEntity class provides a similar implementation of the GetEntityType method. The example usage creates two instances of AnimalEntity, a dog and a cat, and retrieves their Types using GetType. The output shows that both instances are of the AnimalEntity Type, but with different property values. The package library for IEntityBase cannot be determined without additional context. It could be part of a larger ORM (Object-Relational Mapping) framework or simply a standalone interface.