Skip to content

Commit

Permalink
27 enhance performance (#35)
Browse files Browse the repository at this point in the history
* Transform now yields digest class for better caching
* Extracted tempates into embedded resources
* Bumped version number
* Updated package output path to local repo
* Updated local publish script
* Removed package-based integration test project
* Renamed project-based integration test project
* Code cleanup
  • Loading branch information
MelGrubb committed May 27, 2023
1 parent de11425 commit 2dc859e
Show file tree
Hide file tree
Showing 43 changed files with 617 additions and 557 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ Install-Package BuilderGenerator
After installation, create a partial class to define your builder in. Decorate it with the ```BuilderFor``` attribute, specifying the type of class that the builder is meant to build (e.g. ```[BuilderFor(typeof(Foo))]```. Define any factory and helper methods in this partial class. Meanwhile, another partial class definition will be auto-generated which contains all the "boring" parts such as the backing fields and "with" methods.

## Version History ##
- v2.3.0
- Major caching and performance improvements
- Internal code cleanup
- Conversion of templates to embedded resources

- v2.2.0
- Changed generated file extension to .g.cs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
</PropertyGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>BuilderGenerator.IntegrationTests.Net60.FromPackage</_Parameter1>
<_Parameter1>BuilderGenerator.IntegrationTests.Net60</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>BuilderGenerator.IntegrationTests.Net60.FromProject</_Parameter1>
<_Parameter1>BuilderGenerator.IntegrationTests.Net60</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

namespace BuilderGenerator.IntegrationTests.Core.Models.Entities;

public class User : AuditableEntity
public partial class User : AuditableEntity
{
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string FirstName { get; set; }

Check warning on line 9 in src/BuilderGenerator.IntegrationTests.Core/Models/Entities/User.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'FirstName' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 9 in src/BuilderGenerator.IntegrationTests.Core/Models/Entities/User.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'FirstName' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
public string LastName { get; set; }

Check warning on line 10 in src/BuilderGenerator.IntegrationTests.Core/Models/Entities/User.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'LastName' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 10 in src/BuilderGenerator.IntegrationTests.Core/Models/Entities/User.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'LastName' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
public string? MiddleName { get; set; }
}

public partial class User
{
public ICollection<Order> Orders { get; set; } = new List<Order>();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Entities #

This folder contains sample entities for which builders will be created. It's your standard, generic Foo/Bar/Baz hierarchy, with edge cases exercised as described blow.

## Hierarchy ##

Foo contains a read-only collection or Bars.
Bars contains a read-only collection of Bazs.
Baz has no children of its own.

Each layer also contains writable collections of strings in various formats to test the Builder's ability to adapt and choose appropriate properties to handle.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using BuilderGenerator.IntegrationTests.Core.Models.Entities;

namespace BuilderGenerator.IntegrationTests.Net60.FromPackage.Builders;
namespace BuilderGenerator.IntegrationTests.Net60.Builders;

[BuilderFor(typeof(CollectionTypesSample))]
public partial class CollectionTypeSampleBuilder
Expand Down

0 comments on commit 2dc859e

Please sign in to comment.