0
sayram created
In my categoryService im adding category entity with this codes.
public void CreateCategory(Category entity)
{
_categoryRepository.Insert(entity);
}
I need the Id number of the inserted entity. How to get it? Ty.
I dont want to use GetCategoryByTitle or something like that because there can be same named categories.
2 Answer(s)
-
0
ok sorry found InsertAndGetId method :)
bunu akıl ettiğn için teşekkürler dostum. Mükemmellik ayrıntılarda gizlidir. :)
-
0
See repository document: <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Repositories#DocInsertEntity">http://www.aspnetboilerplate.com/Pages/ ... sertEntity</a>
There is a method named InsertAndGetId for that.