public IActionResult AddElectricByOrganization(ElectricsByOrganizationDto model) { var electric = model.MapTo <ElectricsByOrganization>(mapper); //roomRental.Room = null; //roomRental.Organization = null; if (ModelState.IsValid) { unitOfWork.GetRepository <ElectricsByOrganization>().InsertAsync(electric); unitOfWork.GetRepository <ElectricsByOrganization>().Save(); return(new ObjectResult("Model added successfully!")); } return(new ObjectResult("Model added unsuccessfully!")); }
public async Task <ActionResult> AddElectricByOrganization(ElectricsByOrganizationDto model) { var response = await RestQuery.ExecuteAsync <List <ElectricsByOrganizationDto> >("http://localhost:57770/", "AddElectricByOrganization", Method.POST, model); return(Json(response)); }