public Error.Types Delete()
 {
     Rds.ExecuteNonQuery(
         transactional: true,
         statements: new SqlStatement[]
     {
         Rds.DeleteMailAddresses(
             where : Rds.MailAddressesWhere().MailAddressId(MailAddressId))
     });
     return(Error.Types.None);
 }
        public Error.Types Delete()
        {
            var statements = new List <SqlStatement>();

            statements.AddRange(new List <SqlStatement>
            {
                Rds.DeleteMailAddresses(
                    where : Rds.MailAddressesWhere().MailAddressId(MailAddressId))
            });
            Rds.ExecuteNonQuery(
                transactional: true,
                statements: statements.ToArray());
            return(Error.Types.None);
        }
        public ErrorData Delete(Context context)
        {
            var statements = new List <SqlStatement>();

            var where = Rds.MailAddressesWhere().MailAddressId(MailAddressId);
            statements.AddRange(new List <SqlStatement>
            {
                Rds.DeleteMailAddresses(where : where)
            });
            Rds.ExecuteNonQuery(
                context: context,
                transactional: true,
                statements: statements.ToArray());
            return(new ErrorData(type: Error.Types.None));
        }
        public Error.Types Delete()
        {
            var statements = new List <SqlStatement>();

            var where = Rds.MailAddressesWhere().MailAddressId(MailAddressId);
            statements.AddRange(new List <SqlStatement>
            {
                Rds.DeleteMailAddresses(where : where)
            });
            var response = Rds.ExecuteScalar_response(
                transactional: true,
                statements: statements.ToArray());

            return(Error.Types.None);
        }
        /// <summary>
        /// Fixed:
        /// </summary>
        private void UpdateMailAddresses()
        {
            var statements = new List <SqlStatement>
            {
                Rds.DeleteMailAddresses(
                    where : Rds.MailAddressesWhere()
                    .OwnerId(UserId)
                    .OwnerType("Users"))
            };

            Session_MailAddresses()?.ForEach(mailAddress =>
                                             statements.Add(Rds.InsertMailAddresses(
                                                                param: Rds.MailAddressesParam()
                                                                .OwnerId(UserId)
                                                                .OwnerType("Users")
                                                                .MailAddress(mailAddress))));
            Rds.ExecuteNonQuery(transactional: true, statements: statements.ToArray());
        }