Hi
I am getting this error -
{ "Message": "An error has occurred.", "ExceptionMessage": "Value cannot be null.\r\nParameter name: entity", "ExceptionType": "System.ArgumentNullException", "StackTrace": " at System.Data.Entity.Utilities.Check.NotNull[T](T value, String parameterName)\r\n at System.Data.Entity.DbSet`1.Add(TEntity entity)\r\n at ProjectManagement.Controllers.EmployeesController.PostEmployee(Employee employee) in C:\\Users\\jagji\\documents\\visual studio 2015\\Projects\\ProjectManagement\\ProjectManagement\\Controllers\\EmployeesController.cs:line 142" }
Below values i entered in PostMan -
[ { "Id": 10, "Name": "Mark 10", "DepartmentId": 1, "Email": "
[email protected]", "Active": "Y", "Gender":"Male" }]
- public partial class Employee {
- public int ID {
- get;
- set;
- }
- public string Name {
- get;
- set;
- }
- public string Email {
- get;
- set;
- }
- public string Gender {
- get;
- set;
- }
- public Nullable < int > Salary {
- get;
- set;
- }
- public Nullable < int > DepartmentId {
- get;
- set;
- }
- public string Active {
- get;
- set;
- }
- public Nullable < System.DateTime > CreatedOn {
- get;
- set;
- }
- public Nullable < System.DateTime > UpdatedOn {
- get;
- set;
- }
Thanks