To make things really simple, flags can be thought of as an int sum (just being simple, but they actually work with bitwise operations).
So, for your case (subject to listing), if there are two goals in the record (student and professor), the final result will be 6.
EF . 6.
, EF INT, , int :
enum Target : int {
( !) .
, , Enum.Parse, ( ), EF .
.
, , :
var item = new Something() { Prop = Target.Student | Target.Professor };
context.Save();
var item2 = context.GetSomething();
if (item2.Prop.HasFlag(Target.Professor) && item2.Prop.HasFlag(Target.Student))
{
}
.
EF6, .
, CodeFirst.
, .NET framework. Enum EF.