Skip to content

Commit 3a9fa9c

Browse files
committed
make deletable
1 parent c7a1ccb commit 3a9fa9c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Rdmp.Core/EntityFramework/Helpers/DatabaseObject.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,21 @@
1313

1414
namespace Rdmp.Core.EntityFramework.Helpers
1515
{
16-
public class DatabaseObject: IMapsDirectlyToDatabaseTable
16+
public class DatabaseObject: IMapsDirectlyToDatabaseTable, IDeleteable
1717
{
1818
public virtual int ID { get; set; }
1919

2020
public virtual RDMPDbContext CatalogueDbContext { get; set; }
2121

2222
public event PropertyChangedEventHandler PropertyChanged;
2323

24+
public void DeleteInDatabase()
25+
{
26+
CatalogueDbContext.Remove(this);
27+
CatalogueDbContext.SaveChanges();
28+
//throw new NotImplementedException();
29+
}
30+
2431
[NotifyPropertyChangedInvocator]
2532
protected virtual void OnPropertyChanged(object oldValue, object newValue,
2633
[CallerMemberName] string propertyName = null)

0 commit comments

Comments
 (0)