Feb 24, 2010 at 4:27 PM
Edited Feb 24, 2010 at 5:17 PM
That resolved my build problem, and I was able to add my column and propagate it up the UI.
However now I've stumbled into another. Now when I try to change group/subgruop assignments the '.HASLoadedOrAssignedValue' property is set to true causing it to always throw ForeignKeyReferenceAlreadyHasValueException when updating the
ticket. (This is my first time working with LINQ to SQL)
I did not change any code related to the Ticket or Groups.
public static ticket Update(stDataContext db, int ticket_id, int status, int priority_id, int assigned_to)
ticket t = Get(db, ticket_id);
t.ticket_status = status;
t.priority = priority_id;
t.assigned_to_group_last = t.assigned_to_group;
t.assigned_to_group = assigned_to; // t.assigned_to_group = db.sub_units.Single(f => f.id == assigned_to).id;
if (status == 5) t.closed = DateTime.Now;
else t.closed = NullDate;
t.last_action = DateTime.Now;
The bolded is the last line in non-generate code getting called before entering the LINQ-SQL file. I did some research, and it stated that you should update the key using an entity and not the value so i tried the code commented out as a
possible fix, but that did not resolve the issue.
Any suggestions as to where/what I should be looking at to try and fix this issue? I'm a complete noob when it comes to LINQ-to-SQL.