Skip to content

The identity factory must not crash when a compatible identity value is used #40

@craigfowler

Description

@craigfowler

Currently, the identity factory requires an identity value to be an exact type match for the desired identity value.

For example, of an entity requires Int64, then an identity cannot be created using an Int32, even though it is compatible/has an implicit cast available. This ticket is to relax that restriction so that compatible types may be used.

Sample exception & stack trace

System.ArgumentException : Identity type `Int64' was specified but provided identity value was a `System.Int32'.
Parameter name: identityValue
  at CSF.Entities.IdentityFactory.Create (System.Type entityType, System.Type identityType, System.Object identityValue)
  at CSF.Entities.Identity.Create[TEntity] (System.Object identityValue)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions