Hi all,
I am trying to extend my edmx with partial classes (database first in c# with visual studio 2019).
In visual studio 2010 I put edmx and partial classes in the same directory.
Then in my partial class I wrote
Now with VS2019 it no longer works, it tells me that the Product class already exists.
In fact it exists, inside the edmx. So I moved my partial classes into a new directory, but it doesn't work.
I tried to rename my classes like Product.partial.cs, but it can't find the string to access.
It was so comfortable to work as before, does anyone suggest anything?
Thanks
A.
I am trying to extend my edmx with partial classes (database first in c# with visual studio 2019).
In visual studio 2010 I put edmx and partial classes in the same directory.
Then in my partial class I wrote
C#:
public partial class Product
{
private dbEntities ctx;
public Product()
{
ctx = new dbEntities(ConfigurationManager.ConnectionStrings["dbEntities"].ConnectionString);
}
~Product()
{
ctx = null;
}
public Product LoadOne(int id)
{
return
(from rec in ctx.Product
where rec.IdProduct.Equals(id)
select rec).FirstOrDefault();
}
//....... another method
}
Now with VS2019 it no longer works, it tells me that the Product class already exists.
In fact it exists, inside the edmx. So I moved my partial classes into a new directory, but it doesn't work.
I tried to rename my classes like Product.partial.cs, but it can't find the string to access.
It was so comfortable to work as before, does anyone suggest anything?
Thanks
A.