|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using Signum.Entities;
using Signum.Engine;
using Signum.Utilities;
namespace Signum.Engine.Maps
{
public partial class Table
{
public SqlPreCommand DeleteSqlSync(IdentifiableEntity ident, string comment = null)
{
return SqlPreCommand.Combine(Spacing.Simple,
OnPreDeleteSqlSync(ident),
new SqlPreCommandSimple("DELETE {0} WHERE id = {1} --{2}".Formato(Name.SqlScape(), ident.Id, comment ?? ident.ToStr))
);
}
public event Func<IdentifiableEntity, SqlPreCommand> PreDeleteSqlSync;
SqlPreCommand OnPreDeleteSqlSync(IdentifiableEntity ident)
{
if (PreDeleteSqlSync == null)
return null;
return PreDeleteSqlSync.GetInvocationList().Cast<Func<IdentifiableEntity, SqlPreCommand>>().Select(a => a(ident)).Combine(Spacing.Simple);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm Computer Scientist, one of the founders of Signum Software, and the lead developer behind Signum Framework.
www.signumframework.com
I love programming in C#, Linq, Compilers, Algorithms, Functional Programming, Computer Graphics, Maths...