Hi Guru
I'm playing with PB2019 and in particular I'm giving the tutorial: 'https://www.appeon.com/support/documents/appeon_online_help/powerbuilder/CRUD_Operations_with_ModelStore/index.html'
In particular I am trying to rename the controller from 'SampleController' to 'Controller'
(of course I also change the 2 internal references to the class).
If I rename it, it doesn't work (see image). if I leave the default name it works.
What am I forgetting?
ty for answers
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// controller class
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using PowerBuilder.Data;
using Cs1Tris.Servizi;
using System.Linq;
namespace Cs1Tris.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
public class Controllore : ControllerBase
{
private readonly IDepartmentServizio _service;
public Controllore(IDepartmentServizio Service)
{
_service = Service;
}
// GET api/Sample/Retrieve
[HttpGet]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public ActionResult Retrieve()
{
IDataStore ds_Department = new DataStore("dw_department");
try
{
ds_Department = _service.Retrieve();
}
catch (Exception ex)
{
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
}
if (ds_Department.RowCount <= 0)
{
return NotFound("No rows retrieved.");
}
else
{
return Ok(ds_Department);
}
}
// GET api/sample/load
[HttpGet]
public ActionResult> Load()
{
return new string[] { "value1", "value2" };
}
}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- ATK Gimmy Susan
- SnapObjects
- Tuesday, 11 June 2019 19:15 PM UTC
- Page :
- 1
There are no replies made for this question yet.
However, you are not allowed to reply to this question.
However, you are not allowed to reply to this question.
I realize I am a noob
G.
And a link into Microsoft's fundamentals intro:
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/?view=aspnetcore-2.1&tabs=windows
Lots of info. Too much to learn everything upfront. But good link to start learning.
/Michael
Hey Gimmy - and everyone else new to C# though experienced in PowerScript.
Remember as you read C# :: C# is case sensitive - which means the following identifiers are completely different seen in C# code though totally identical seen in PowerScript code:
d_customers -- d_Customers -- D_Customers -- D_Customers -- D_CUSTOMERS -- d_cUstOmErs
And in C# you have namespaces which in PowerScript would be like referencing class names by PBLibrary. Say in PB I have n_calculator in Utility.PBL and later in library list same class name in Science.PBL. If PowerScript had namespaces, it would be like:
lnv_calc = create Science.n_calculator
In PowerScript, multiple classes identically named of identical type across multiple .PBL files => First in Library List wins.
HTH /Michael