Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TId.New() for guid-based ids, implicit and explicit conversions to underlying type #13

Merged
merged 4 commits into from
Nov 26, 2024

Conversation

kzu
Copy link
Member

@kzu kzu commented Nov 26, 2024

No description provided.

This makes it much shorter and akin to using Guid.NewGuid().
Following framework guidelines, allow implicit cast from struct id to underlying type, and explicit cast the other way around (to make intent explicit).
IParsable and static interface implementations are a .NET7+ feature already, so no point in conditioning it.
@kzu kzu added the enhancement New feature or request label Nov 26, 2024
@devlooped-bot
Copy link
Member

devlooped-bot commented Nov 26, 2024

27 passed 27 passed

🧪 Details on Microsoft Windows 10.0.20348

✅ StructId.ComparableGeneratorTests.GenerateComparable
✅ StructId.ComparableGeneratorTests.GenerateStringParseable
✅ StructId.ConstructorGeneratorTests.GenerateRecordConstructor
✅ StructId.ConstructorGeneratorTests.GenerateRecordConstructorInGlobalNamespace
✅ StructId.ConstructorGeneratorTests.GenerateRecordStringConstructor
✅ StructId.Functional.FunctionalTests.Dapper
✅ StructId.Functional.FunctionalTests.EntityFramework
✅ StructId.Functional.FunctionalTests.EqualityTest
✅ StructId.Functional.FunctionalTests.ImplicitAndExplicitCast
✅ StructId.Functional.FunctionalTests.Newtonsoft
✅ StructId.NewtonsoftJsonGeneratorTests.DoesNotGenerateIfNewtonsoftJsonNotPresent
✅ StructId.NewtonsoftJsonGeneratorTests.GenerateIfNewtonsoftJsonPresent
✅ StructId.ParsableGeneratorTests.GenerateParseable
✅ StructId.ParsableGeneratorTests.GenerateStringParseable
✅ StructId.ParsableGeneratorTests.NoParseableAvailable
✅ StructId.RecordAnalyzerTests.ClassNotStructId
✅ StructId.RecordAnalyzerTests.PartialRecordStructNotReadonly
✅ StructId.RecordAnalyzerTests.PartialStringRecordStructNotReadonly
✅ StructId.RecordAnalyzerTests.ReadonlyRecordStructNoStructId
✅ StructId.RecordAnalyzerTests.ReadonlyRecordStructNotPartial
✅ StructId.RecordAnalyzerTests.ReadonlyStringRecordStructNotPartial
✅ StructId.RecordAnalyzerTests.RecordStructNoStructId
✅ StructId.RecordAnalyzerTests.RecordStructNotReadonlyNorPartial
✅ StructId.RecordAnalyzerTests.StructNotStructId
✅ StructId.RecordCodeFixTests.AddPartialKeyword
✅ StructId.RecordCodeFixTests.AddReadOnlyModifier
✅ StructId.RecordCodeFixTests.ChangeRecordStruct

from dotnet-retest v0.6.3 on .NET 8.0.11 with 💜

@kzu kzu merged commit cd02e83 into main Nov 26, 2024
11 checks passed
@kzu kzu deleted the dev/minor branch November 26, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants