Above code snippet is written in Repository layer and adds catalog object. I want to return some integer value back to the calling function which is in Business layer. But i want to do it without calling:
catalog.CatalogId is primary key in the table which is an identity field and set to auto increment.
Your entity id, in your case "CatalogId" will have right value after inserting the entity and you need to call SaveChanges() method before you want to use it.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)