How to save enum in database as string

后端 未结 6 696
北恋
北恋 2020-12-29 02:59

This is my Model Class where we have a Type which could be a Zombie or Human

public class User
{
    public int ID { get; set; }
    public string Name { ge         


        
6条回答
  •  心在旅途
    2020-12-29 03:36

    It's not a good idea to store them as string but you can create look up tables for your enums with ef enum to lookup and it is very easy to use.

提交回复
热议问题