0
feliw created
Hi,
I try to figure this error, but seems everything is okay but I receive "Your request is invalid", I already check the request payload and my JSON string seems okay, same as my DTO. Can advice me where I did wrong ?
The JSON seems cannot be serialize to CreateShiftDto so it return me "input is null"
Thanks before
Here is my piece of code
Service
public bool Create(CreateShiftDto input)
{
try
{
_shiftRepository.Insert(input.MapTo<Shift>());
return true;
}
catch (Exception ex)
{
Logger.Debug(ex.Message);
throw ex;
}
}
Angular function
function create() {
shiftsService.create(vm.shiftss).success(function (result) {
abp.notify.success("Data is created!");
back();
}).error(function (result) {
abp.notify.error(result);
});
}
this is my object (vm.shiftss)
"[{"seq":5,"code":"5","description":"555","timeStart":"2016-04-12T09:53:36.607Z","timeEnd":"2016-04-12T09:53:36.607Z"}]"
and this is my DTO
[AutoMap(typeof(Shift))]
public class CreateShiftDto : IInputDto
{
public virtual int Seq { get; set; }
public virtual string Code { get; set; }
public virtual string Description { get; set; }
public virtual DateTime TimeStart { get; set; }
public virtual DateTime TimeEnd { get; set; }
}