internal void ApplyTo(MetaEntityStore store) { foreach (var action in _actions) { action(store); } }
public MetadataBuilder RegisterEntity <T>(Action <MetadataEntityBuilder <T> > action = null) { actions.Add((store) => { if (store.ContainsKey(typeof(T))) { throw new Exception($"{ typeof(T).FullName } already registered"); } var typeData = new MetaEntityStore(); store.Add(typeof(T), typeData); var entityBuilder = new MetadataEntityBuilder <T>(); if (action != null) { action(entityBuilder); } entityBuilder.ApplyTo(typeData); }); return(this); }