private TypeBuilder GetTypeBuilder(Type sourceType, ModuleBuilder moduleBuilder) { return(moduleBuilder.DefineType( SnapshotNameGenerator.Generate(sourceType), TypeAttributes.Class | TypeAttributes.Public | TypeAttributes.Serializable | TypeAttributes.Sealed, SnapshotBaseType)); }
public bool DoesAggregateSupportsSnapshot(Type aggregateType, Type snapshotType) { bool hasAttribute = aggregateType.HasAttribute <DynamicSnapshotAttribute>(); bool doesSupportSnapshot = snapshotType.Name == SnapshotNameGenerator.Generate(aggregateType); return(hasAttribute && doesSupportSnapshot); }