public void ForeignKey()
        {
            ForeignListViewModel list = IoC.Get <ForeignListViewModel>();

            list.Entity = this;
            list.Title  = $"实体“{GetName()}”的外键管理";
            list.Init();
            list.IsShow = true;
        }
예제 #2
0
        public async void Delete()
        {
            if (MessageBox.Show($"是否删除实体外键“{SelfNavigation??SelfForeignKey}”?", "请确认", MessageBoxButton.OKCancel, MessageBoxImage.Question) == MessageBoxResult.Cancel)
            {
                return;
            }
            OperationResult result = null;
            await _provider.ExecuteScopedWorkAsync(async provider =>
            {
                IDataContract contract = provider.GetRequiredService <IDataContract>();
                result = await contract.DeleteCodeForeigns(Id);
            });

            Helper.Notify(result);
            if (!result.Succeeded)
            {
                return;
            }

            ForeignListViewModel list = IoC.Get <ForeignListViewModel>();

            list.Init();
        }