I am using ExcecuteSqlCommand for update and insert, which will return an integer but i want the entire inserted or updated row. Using FromSql the updation and insertion are not happening, i am able to fetch only the items. How can i achieve this?
If you are using EF , you'd better insert/update via DbContext :
https://www.learnentityframeworkcore.com/dbcontext/adding-data
https://www.learnentityframeworkcore.com/dbcontext/modifying-data
Book book = new Book();
book.Title = "Title1";
_context.Book.Add(book);
await _context.SaveChangesAsync();
var id = book.BookId;
EF will help you fill the enitity after operations , include the new added identity column value.