Quantcast
Channel: URF - Unit of Work & (extensible/generic) Repositories Framework
Viewing all articles
Browse latest Browse all 1539

Created Unassigned: How to get inserted Id. [1244]

$
0
0
Hi. Is there any possibility to get inserted id of a just inserted entity without querying database again?

```
public int Create(ItemGroupDto itemGroupDto)
{
var itemGroup = Mapper.Map<ItemGroupDto, vwItemGroup>(itemGroupDto);
_repositoryAsync.Insert(itemGroup);
_unitOfWorkAsync.SaveChanges();
return itemGroup.EntityID;
}
```

I need to get itemGroup.EntityID but its 0. Could you please help me to solve that problem?
Regards,
Oleksandr


Viewing all articles
Browse latest Browse all 1539

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>