Good catch, this solved my issue. Thanks.
Hi,
This is my .js (_CreateOnyxClientModal.js)
(function () { app.modals.CreateOnyxClientModal = function () {
var _modalManager;
var _onyxclientService = abp.services.app.onyxclient;
var _$form = null;
this.init = function (modalManager) {
_modalManager = modalManager;
_$form = _modalManager.getModal().find('form');
_$form.validate();
};
this.save = function() {
if (!_$form.valid()) {
return;
}
var onyxclient = _$form.serializeFormToObject();
_modalManager.setBusy(true);
_onyxclientService.createOnyxClient(onyxclient).done(function () {
_modalManager.close();
location.reload();
}).always(function () {
_modalManager.setBusy(false);
});
};
};
})(jQuery);
And this is OnyxClientAppService.cs
using Abp.Application.Services.Dto; using Abp.AutoMapper; using Abp.Collections.Extensions; using Abp.Domain.Repositories; using Abp.Extensions; using Sixoclock.Onyx.Entities; using Sixoclock.Onyx.OnyxClients.Dto; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks;
namespace Sixoclock.Onyx.OnyxClients { public class OnyxClientAppService : OnyxAppServiceBase, IOnyxClientAppService { private readonly IRepository<OnyxClient> _onyxclientRepository;
public OnyxClientAppService(IRepository<OnyxClient> onyxclientRepository)
{
_onyxclientRepository = onyxclientRepository;
}
public ListResultDto<OnyxClientListDto> GetOnyxClients(GetOnyxClientsInput input)
{
var onyxclientss = _onyxclientRepository
.GetAll()
.WhereIf(
!input.Filter.IsNullOrEmpty(),
p => p.Name.Contains(input.Filter) ||
p.EmailAddress.Contains(input.Filter)
)
.OrderBy(p => p.Name)
.ToList();
return new ListResultDto<OnyxClientListDto>(ObjectMapper.Map<List<OnyxClientListDto>>(onyxclientss));
}
public async Task CreateOnyxClient(CreateOnyxClientInput input)
{
var onyxclient = input.MapTo<OnyxClient>();
await _onyxclientRepository.InsertAsync(onyxclient);
}
}
}
I've used the example and replaced "person" with onyxclient and "Person" with "OnyxClient". "People" became "OnyxClients".
Thanks
I resolved this issue by changing
<PackageReference Include="System.Net.Http" Version="4.3.1" />
to
<PackageReference Include="System.Net.Http" Version="4.3.2" />
in the .csproj file. Now back to work..