Skip to content

[Core] Add support to exclude non-table Class Properties in all Operations. #189

@mikependon

Description

@mikependon

If you have a table below

CREATE TABLE [dbo].[Person]
(
	[Id] INT PRIMARY IDENTITY(1, 1)
	, [Name] NVARCHAR(128)
	, [UpdatedDate] DATETIME2(5)
);

And class like below

public class Person
{
	public int Id { get; set; }
	public string Name { get; set; }
	public DateTime UpdatedDate { get; set; }
	public string SSN { get; set; } // As extra property/field
}

Then the calls to following methods must not be failed.

connection.BatchQuery<Person>(...);
connection.Query<Person>(1);
connection.QueryAll<Person>();
connection.Insert<Person>(entity);
connection.InsertAll<Person>(entities);
connection.Merge<Person>(entity);
connection.MergeAll<Person>(entities);
connection.Update<Person>(entity);
connection.Update<Person(entity, 1);
connection.UpdateAll<Person>(entities);

Currently, RepoDb is failing as it is including this extra columns in all operations.

Metadata

Metadata

Assignees

Labels

deployedFeature or bug is deployed at the current releaseenhancementNew feature or requestfeatureDefined as a big development item (feature)priorityTop priority feature or things to dotodoThings to be done in the future

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions