Partial Entity

Apr 30, 2016 at 4:24 AM
I have a large table with many columns, is it possible to use a partial entity? will i run into any problems with using it?
Apr 30, 2016 at 12:03 PM
of course you can.
Your C# model can define a number of properties that is less of table columns. Supposing a table as:

CREATE TABLE [Customers](
[Id] [int] IDENTITY(1, 1) NOT NULL,
[Name] [nvarchar](50) NULL,
[Surname] [nvarchar](50) NULL,
[Address] [nvarchar](50) NULL,
[ZipCode] [int] NULL,
[City] [nvarchar](50) NULL,
[Country] [nvarchar](50) NULL)
You can have a model as:

public class Customers
public int Id { get; set; }
public string Name { get; set; }
public string Surname { get; set }
public string Country{ get; set; }

Keep in mind that you will receive notification only when properties defined in the model are changed.
So, if address is changed, your code will not be notified.
Marked as answer by alpha68 on 4/30/2016 at 11:10 AM
Apr 30, 2016 at 7:09 PM
Thank-you for your prompt and clear explanation, this is such a great tool.

George Gassios
May 1, 2016 at 9:27 AM
No problem. You are welcome.
Please, rate te project with some starts.