Base solution for your next web application
Open Closed

How to insert record with proper values in DB? #3994


User avatar
0
manojreddy created

I have a columns FlgStdTest which is DEFAULT ((1)) and datatype is bit. I'm trying to insert the record with FlgStdTest as true or false, but its value is always inserted as true.

public async Task<int> CreateTest(TestDetailsDTO input)
    {
        int testId = await InsertAndGetIdAsync(ObjectMapper.Map<TestMaster>(input));

        return testId;
    }

    [AutoMap(typeof(TestMaster))]
public class TestDetailsDTO : FullAuditedEntityDto
{
    public string Test { get; set; }
    public string TestDesc { get; set; }
    public bool FlgStdTest { get; set; }
    public bool FlgActive { get; set; }
}

Request:

{
  "testType": "abc",
  "testDesc": "xyz",
  "flgStdtest": false,
  "flgActive": false,
  "isDeleted": false,
  "deleterUserId": 0,
  "deletionTime": "2017-10-05T10:50:13.956Z",
  "lastModificationTime": "2017-10-05T10:50:13.956Z",
  "lastModifierUserId": 0,
  "creationTime": "2017-10-05T10:50:13.956Z",
  "creatorUserId": 0,
  "id": 0
}

1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you also share your FlgStdTest field in entity TestMaster ?