AutoEntity.cs 486 B

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