Skip to content

Deferred delete and root objects #4110

Discussion options

You must be logged in to vote

Like this:

using Csla;
using Csla.Configuration;
using Csla.Core;
using Csla.Server;
using Microsoft.Extensions.DependencyInjection;
using MyCode;
using ObjectFactory = Csla.Server.ObjectFactory;

var services = new ServiceCollection();
services.AddCsla();
var serviceProvider = services.BuildServiceProvider();

var portal = serviceProvider.GetRequiredService<IDataPortal<PersonEdit>>();
var obj = portal.Fetch();
Console.WriteLine($"Id: {obj.Id}, Name: {obj.Name}, IsDeleted: {obj.IsDeleted}, IsNew: {obj.IsNew}");
obj.Delete();
Console.WriteLine($"Id: {obj.Id}, Name: {obj.Name}, IsDeleted: {obj.IsDeleted}, IsNew: {obj.IsNew}");
await obj.SaveAndMergeAsync();
Console.WriteLine($"Id: {obj.Id},…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@rockfordlhotka
Comment options

@Chicagoan2016
Comment options

@rockfordlhotka
Comment options

Answer selected by Chicagoan2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants