I have got a entity and I want delete this entity
if I writes follow code , i can delete entety
entity=4;
group = new GroupEntity(entityID);
group.Delete();
but this code ,firts select entity and later delete I dont want this way
I writes follow code
entity=4;
group = new GroupEntity();
group.Fields[(int)GroupFieldIndex.Id].ForcedCurrentValueWrite(entityID);
group.Delete();
but give me a error in group.Delete row:
The delete action of an entity failed, probably due to the set delete restriction provided. The entity which failed is enclosed.
when group.Delete() sql profiler runs delete query
exec sp_executesql N'DELETE FROM [NMS].[dbo].[Group] WHERE ( ( [NMS].[dbo].[Group].[ID] = @Id1) AND (
[NMS].[dbo].[Group].[ID] IS NULL AND [NMS].[dbo].[Group].[Name] IS NULL AND
[NMS].[dbo].[Group].[DynamicGroupFilterID] IS NULL))',N'@Id1 int',@Id1=4