Party Error When Adding Customer / Vendor
CompleteCoders opened this issue · 3 comments
Not sure what the party table is meant to do. I am getting an error when creating a new vendor because party is null in the following code. I would have tried to fix it but I don't understand how the Party table is used in the system.
if (model.Id != 0)
{
vendor = _purchasingService.GetVendorById(model.Id.Value);
}
else
{
vendor = new Vendor();
}
vendor.Party.Name = model.VendorName;
Hi,
Apology for late reply. The Party entity is a common object for Customer,
Vendor and Contact. Initially, It was designed as abstract class and
Customer, Vendor, and Contact derived from it. (i.e. Customer: Party,
Vendor : Party, Contact : Party).
However, the latest EF7 seems like have an issue mapping to it so we've put
this as a Navigation property.
So you need to initialize the Party when you create a new instance of the
Vendor.
Hope that helps!
Cheers,
Marvs
On Fri, Apr 29, 2016 at 2:25 AM, CompleteCoders notifications@github.com
wrote:
Not sure what the party table is meant to do. I am getting an error when
creating a new vendor because party is null in the following code. I would
have tried to fix it but I don't understand how the Party table is used in
the system.if (model.Id != 0) { vendor = _purchasingService.GetVendorById(model.Id.Value); } else { vendor = new Vendor(); } vendor.Party.Name = model.VendorName;
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#28
Thanks. I haven't worked in open source ever before. Is this something I should fix and request a pull for? As far as I can see the add customer and add vendor is completely broken at the moment.
No worries. I assume you have forked the project. Feel free to send a pull request.
-----Original Message-----
From: "CompleteCoders" notifications@github.com
Sent: 5/1/2016 10:58 PM
To: "AccountGo/accountgo" accountgo@noreply.github.com
Cc: "codemvp" mvpsolution@gmail.com; "Comment" comment@noreply.github.com
Subject: Re: [AccountGo/accountgo] Party Error When Adding Customer / Vendor(#28)
Thanks. I haven't worked in open source ever before. Is this something I should fix and request a pull for? As far as I can see the add customer and add vendor is completely broken at the moment.
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub