.NET Database Enumeration

One of my objects in the project is House, which has many enumeration properties (for example, the type of house). Using .NET, Linq to Sql and Sql Server, how can I create an enumerated db and use it with Linq to Sql? What should be my approach?

+3
source share
3 answers

If you just want to map something like a property HouseTypeto a table column House. Then LINQ to SQL will do it for you.

See this article for an example.

This article shows how to use the listing as the discriminator column. Not related to the question, but very convenient.

+3

L2S , , "", (, HouseTypeEnum). . # , , . .

+1

Either you create a separate table for the enumeration, or simply save this type of object as an int in .net, you create an enumeration, and then pass it to the int or visa verse

0
source

Source: https://habr.com/ru/post/1737526/


All Articles