public TaskManagement.Api.Models.Category Save(TaskManagement.Api.Models.Category category) { var cat = CategoryMapper.CreateCategory(category); context.tbl_category.Add(cat); context.SaveChanges(); // return the insert element with the right id return(CategoryMapper.CreateCategory(cat)); }