AnantLabs / codesmith

Automatically exported from code.google.com/p/codesmith
1 stars 0 forks source link

Updated property values not reflected in LastAudit.ToXml() #487

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Updated properties aren't reflected in LastAudit (inserts are working, updates 
are not)

What steps will reproduce the problem?
1. Submit a DTO with a new Name and Code value to a method such as this:

        public bool Update(ClientDto clientDto)
        {
            try
            {
                var client = ClientExtensions.GetByKey(DataContext.GetTable<Client>(), clientDto.Id);

                client.Name = clientDto.Name;
                client.Code = clientDto.Code;

                DoIt();

                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }

DoIt() looks like this:

        public void DoIt()
        {
            DataContext.SubmitChanges();

            if (DataContext.LastAudit == null) return;

            var auditLog = new AuditLog { AuditLogID = Guid.NewGuid(), AuditInfo = DataContext.LastAudit.ToXml() };

            DataContext.AuditLog.InsertOnSubmit(auditLog);

            DataContext.SubmitChanges();
        }

DataContext is created in the constructor of a base class.

2. When this is run, Current and Original in LastAudit are exactly the same, so 
no properties appear in the XML:

<audit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" username="" 
date="2010-08-10T16:38:45.8462966-05:00" 
xmlns="http://schemas.codesmithtools.com/datacontext/audit/1.0">    <entity 
action="Update" type="Data.Client">      <key name="ClientID" 
type="System.Guid">        <value xmlns:q1="http://microsoft.com/wsdl/types/" 
xsi:type="q1:guid">765ddf11-8182-4694-9258-bcfa54ae5b63</value>      </key>    
</entity>  </audit>

The record saves successfully but the audit log doesn't seem to be tracking 
those property changes.

Original issue reported on code.google.com by chris.gu...@gmail.com on 10 Aug 2010 at 10:12

GoogleCodeExporter commented 9 years ago
I should have noted this was an issue with PLINQO v5.0.0.1687

Original comment by chris.gu...@gmail.com on 10 Aug 2010 at 10:19

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 16 Aug 2010 at 3:15

GoogleCodeExporter commented 9 years ago
This could very well be the same as issue 445. Any news on this?

Original comment by karb...@gmail.com on 27 Aug 2010 at 7:24

GoogleCodeExporter commented 9 years ago
Can you provide a sample that i can debug to help track down the issue?  you 
can send it to support@codesmithtools.com.

Original comment by paul.wel...@gmail.com on 31 Aug 2010 at 9:24

GoogleCodeExporter commented 9 years ago
dupe of issue 445.
confirmed fixed in r2017 (Plinqo 5.0.4)

Original comment by stafford...@gmail.com on 29 Aug 2012 at 10:50

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 29 Aug 2012 at 1:15