示例#1
0
        public PostgreSqlDataSource AttachSoftDeleteRulesWithUser(PostgreSqlDataSource source)
        {
            var currentUser1 = source.From(EmployeeTableName).WithLimits(1).ToObject <Employee>().Execute();

            return(source.WithRules(
                       new SoftDeleteRule("DeletedFlag", true),
                       new UserDataRule("DeletedByKey", "EmployeeKey", OperationTypes.Delete),
                       new DateTimeRule("DeletedDate", DateTimeKind.Local, OperationTypes.Delete)
                       ).WithUser(currentUser1));
        }
示例#2
0
 //public string TableFunction2Name { get { return "Sales.CustomersByStateInline"; } }
 public PostgreSqlDataSource AttachRules(PostgreSqlDataSource source)
 {
     return(source.WithRules(
                new DateTimeRule("CreatedDate", DateTimeKind.Local, OperationTypes.Insert),
                new DateTimeRule("UpdatedDate", DateTimeKind.Local, OperationTypes.InsertOrUpdate),
                new UserDataRule("CreatedByKey", "EmployeeKey", OperationTypes.Insert),
                new UserDataRule("UpdatedByKey", "EmployeeKey", OperationTypes.InsertOrUpdate),
                new ValidateWithValidatable(OperationTypes.InsertOrUpdate)
                ));
 }