Add Authorities to lookups
Issue #926
resolved
No description provided.
Comments (4)
-
repo owner -
repo owner In summary, this is built on communication between Restangular, Web Api and EntityFramework. The reusable plumbing is implemented in the TableMaintenanceController base class, and the DynamicBinder<> generic
-
reporter - changed status to resolved
feat(Lookups): Add support to edit authorities and related maintenance tables
Resolves
#926→ <<cset a5bbf5c6004f>>
-
repo owner - Log in to comment
To add the ability to edit a table to the lookups table maintenance the steps are quite straightforward:
pCreateUser
,pCreateDateTime
,pEditUser
,pEditDateTime
,pRowversion
SimpleCodeTable
orSequencedCodeTable
. Add a table [Description] attribute to get this in the lookups editor. Also note if you ultimately want to get a dropdown list of some other lookup in the editor grid, add the [ClientLookup] attribute to the field. The better this class is defined by attributes, the better the result will be.Change the primary key to
code
(string) orID
(int) and rely on the [Column] attribute to map this to the correct field name.Add the new entity collection to PineapplesEFContext
controllers_api
orcontrollers_api/lookups
Choice depends on whether this is a ‘lookup;’ table or an application entity (e.g. for authorities, I’d go withcontrollers_api)
.This controller should inherit from TableMaintenanceController. Typically you’ll copy and modify an existing one, so be careful to set up all the generic parameters correctly, for the data type of the key etc., check the [RoutePrefrix] also.
#!/tables
, add the new controller name to LookupsController.editableTables. This is the source of the dropdown list of editable tables in#!/tables
.TROUBLESHOOTING: use fiddler to make sure that you are getting the correct api calls generated for your entity type. Be especially careful that a PUT should include the primary key value e.g.
api/authorities/foo
. If you are not getting the primary key in the url, check step 3. (and note how this relates togetIdFromElem
in ConfigRestangularPinappples).