dotnet / dotnet/EntityFramework.Docs

Parsing Enum could be simplified

Open
#4,278 0 comments 0 reactions 0 assignees View on GitHub
area-change-tracking area-model-building
Dominant language
Mermaid
Stars
1.7k
Forks
2k
Avg merge
7d 23h
Merged PRs (30d)
16

Description

The code:
```csharp
v => (EquineBeast)Enum.Parse(typeof(EquineBeast), v))
```
could be simplified:
```csharp
v => Enum.Parse(v)
```

---
#### Document Details

⚠ *Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.*

* ID: 03dfe9f6-e831-ac3f-0b90-acb9b4c0f828
* Version Independent ID: a26156d1-a4b3-7df0-e63e-b8e9f804abbf
* Content: [Value Conversions - EF Core](https://learn.microsoft.com/en-us/ef/core/modeling/value-conversions?tabs=data-annotations)
* Content Source: [entity-framework/core/modeling/value-conversions.md](https://github.com/dotnet/EntityFramework.Docs/blob/main/entity-framework/core/modeling/value-conversions.md)
* Product: **entity-framework**
* Technology: **entity-framework-core**
* GitHub Login: @ajcvickers
* Microsoft Alias: **avickers**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.