public static dynamic GetTSObject(DetailTypeEnum dynEnum) { var tsType = TSActivator.CreateInstance("Tekla.Structures.DetailTypeEnum").GetType(); switch (dynEnum) { case DetailTypeEnum.END: return(System.Enum.Parse(tsType, "END")); case DetailTypeEnum.INTERMEDIATE: return(System.Enum.Parse(tsType, "INTERMEDIATE")); case DetailTypeEnum.INTERMEDIATE_REVERSE: return(System.Enum.Parse(tsType, "INTERMEDIATE_REVERSE")); default: throw new DynamicAPIException(dynEnum.ToString() + "- enum value is not implemented"); } }
private async Task <DetailTypeReadModel> GetDetailType(DetailTypeEnum detailType) { var types = await this.GetDetailTypes().ConfigureAwait(false); return(types.First(x => x.Code.Equals(detailType.ToString()))); }