aspnetboilerplate - How to pass object in method to call service API in ASP.NET Boilerplate? -
i have defined method defined in appservice file, signature of method public pagedresultdto<fetchdata> getsearchdata(fetchdatainput searchinput). i'm calling method angular code, service-proxoes.ts file has generated method in need pass parameters 1 one.
public class fetchdatainput: pagedandsortedinputdto, ishouldnormalize { public int datalevel { get; set; } public int datatype { get; set; } public string datacode { get; set; } public string desclong { get; set; } public string languagecode { get; set; } public string dataparent { get; set; } public void normalize() { if (string.isnullorempty(sorting)) { sorting = "datacode"; } } } service-proxies.ts file:
getsearchdata(datalevel: number, datatype: number, datacode: string, desclong: string, languagecode: string, dataparent: string, sorting: string, maxresultcount: number, skipcount: number): observable<pagedresultdtooffetchdata> { so have call getsearchdata method following way.
this._dataservice.getsearchdata(appconsts.dataleveltype, undefined, undefined, undefined, this.currentlanguage.name, undefined, undefined, undefined, undefined).subscribe((result) => { //result.items; }); so have pass parameters, if let's there 100 parameters, error prone , not programming style. has take class object that's it. there way this?
Comments
Post a Comment