I have a Linq to SQL entity which emit the following two sql statements:
UPDATE [identity].[AddressTypes]
SET [Name] = @p4
WHERE ([SurrogateKey] = @p0) AND ([Name] = @p1) AND ([LastUpdatedOn] = @p2) AND ([LastUpdatedBy] = @p3)
-- @p0: Input UniqueIdentifier (Size = 0; Prec = 0; Scale = 0) [b0cf44d9-c6ba-de11-b194-001e37f334ea]
-- @p1: Input VarChar (Size = 11; Prec = 0; Scale = 0) [Residencial]
-- @p2: Input DateTime (Size = 0; Prec = 0; Scale = 0) [16/10/2009 23:43:28]
-- @p3: Input NVarChar (Size = 23; Prec = 0; Scale = 0) [LUCIANO-NOTEBOO\Luciano]
-- @p4: Input VarChar (Size = 4; Prec = 0; Scale = 0) [Home]
-- Context: SqlProvider(Sql2008) Model: AttributedMetaModel Build: 3.5.30729.1
UPDATE [identity].[AddressTypes]
SET [Name] = @p4
WHERE ([SurrogateKey] = @p0) AND ([Name] = @p1) AND ([LastUpdatedOn] = @p2) AND ([LastUpdatedBy] = @p3)
-- @p0: Input UniqueIdentifier (Size = 0; Prec = 0; Scale = 0) [b1cf44d9-c6ba-de11-b194-001e37f334ea]
-- @p1: Input VarChar (Size = 9; Prec = 0; Scale = 0) [Comercial]
-- @p2: Input DateTime (Size = 0; Prec = 0; Scale = 0) [16/10/2009 23:43:29]
-- @p3: Input NVarChar (Size = 23; Prec = 0; Scale = 0) [LUCIANO-NOTEBOO\Luciano]
-- @p4: Input VarChar (Size = 8; Prec = 0; Scale = 0) [Business]
-- Context: SqlProvider(Sql2008) Model: AttributedMetaModel Build: 3.5.30729.1
But I need the Entity to emit the sql statements like the ones below, where LastUpdatedOn and LastUpdatedBy are set to their default values. I guess I'll have to implement Extensibility Method Definition for "partial void Update...", but don't know how to proceed. Anybody out there could please help me solve that?
UPDATE [identity].[AddressTypes]
SET [Name] = @p4, [LastUpdatedOn] = DEFAULT, [LastUpdatedBy] = DEFAULT
WHERE ([SurrogateKey] = @p0) AND ([Name] = @p1) AND ([LastUpdatedOn] = @p2) AND ([LastUpdatedBy] = @p3)
-- @p0: Input UniqueIdentifier (Size = 0; Prec = 0; Scale = 0) [b0cf44d9-c6ba-de11-b194-001e37f334ea]
-- @p1: Input VarChar (Size = 11; Prec = 0; Scale = 0) [Residencial]
-- @p2: Input DateTime (Size = 0; Prec = 0; Scale = 0) [16/10/2009 23:43:28]
-- @p3: Input NVarChar (Size = 23; Prec = 0; Scale = 0) [LUCIANO-NOTEBOO\Luciano]
-- @p4: Input VarChar (Size = 4; Prec = 0; Scale = 0) [Home]
-- Context: SqlProvider(Sql2008) Model: AttributedMetaModel Build: 3.5.30729.1
UPDATE [identity].[AddressTypes]
SET [Name] = @p4, [LastUpdatedOn] = DEFAULT, [LastUpdatedBy] = DEFAULT
WHERE ([SurrogateKey] = @p0) AND ([Name] = @p1) AND ([LastUpdatedOn] = @p2) AND ([LastUpdatedBy] = @p3)
-- @p0: Input UniqueIdentifier (Size = 0; Prec = 0; Scale = 0) [b1cf44d9-c6ba-de11-b194-001e37f334ea]
-- @p1: Input VarChar (Size = 9; Prec = 0; Scale = 0) [Comercial]
-- @p2: Input DateTime (Size = 0; Prec = 0; Scale = 0) [16/10/2009 23:43:29]
-- @p3: Input NVarChar (Size = 23; Prec = 0; Scale = 0) [LUCIANO-NOTEBOO\Luciano]
-- @p4: Input VarChar (Size = 8; Prec = 0; Scale = 0) [Business]
-- Context: SqlProvider(Sql2008) Model: AttributedMetaModel Build: 3.5.30729.1
Regards,