public static IntervalType Create(IntervalTypesEnum enumItem)
        {
            IntervalType type = new IntervalType
            {
                IntervalCode = (int)enumItem,
                IntervalName = enumItem.ToString(),
            };

            return(type);
        }
 public bool IsEqual(IntervalTypesEnum enumItem)
 {
     return(this.IntervalName == enumItem.ToString());
 }
        public async Task <IntervalType> FindTypeByTypesEnum(IntervalTypesEnum enumItem)
        {
            IntervalType intervalType = await context.IntervalTypes.FirstOrDefaultAsync(t => t.IntervalName == enumItem.ToString());

            return(intervalType);
        }