AutoEntity.cs 449 B

1234567891011121314151617181920
  1. using System;
  2. namespace InABox.Core
  3. {
  4. public interface IAutoEntityGenerator
  5. {
  6. bool Distinct { get; }
  7. Type Definition { get; }
  8. }
  9. public class AutoEntity : Attribute
  10. {
  11. public IAutoEntityGenerator? Generator { get; private set; }
  12. public AutoEntity(Type generator) : base()
  13. {
  14. Generator = Activator.CreateInstance(generator) as IAutoEntityGenerator;
  15. }
  16. }
  17. }