public async Task CreateEnumAsync(Models.Enum @enum) { var coreProject = GetProject("Core"); var path = coreProject.GetPath("Metadata", "Enums"); coreProject.VerifyPathExists("Metadata", "Enums"); var filePath = System.IO.Path.Combine(path, @enum.Name + MetadataFileExtension); await WriteFileAsync(filePath, SerializeMetadata(@enum)); }
public async Task UpdateEnumAsync(Models.Enum @enum) { var existingEnum = (await GetEnumsAsync()).FirstOrDefault(e => e.Id == @enum.Id); if (existingEnum == null) { throw new Exception($"Enum with Id = {@enum.Id} not found"); } var coreProject = GetProject("Core"); var path = coreProject.GetPath("Metadata", "Enums"); var filePath = System.IO.Path.Combine(path, @enum.Name + MetadataFileExtension); await WriteFileAsync(filePath, SerializeMetadata(@enum)); if (existingEnum.Name != @enum.Name) { filePath = System.IO.Path.Combine(path, existingEnum.Name + MetadataFileExtension); File.Delete(filePath); } }
public EnumViewModel(View view, Models.Enum @enum, SolutionAccessor solution) { View = view; Enum = @enum; Solution = solution; }
public EnumModel(Models.Enum @enum, SolutionAccessor solution) { Enum = @enum; Solution = solution; }