odata

OData : Why am I getting HTTP 428 (Precondition Required) error while performing an update

放肆的年华 提交于 2019-12-26 05:06:28
问题 So here's my code sap.ui.getCore().getModel("myModel").update("/ZSystemNameSet(mandt='001')", data, null, function(datay, responsey){ sap.ui.getCore().getModel().refresh(); MessageToast.show("It worked...!! Data: "+datay+"Response: "+responsey); }, function(datax,responsex){ MessageToast.show("Sorry! Data: "+datax+"Response: "+responsex); }); Also how do I add the header attributes to the update() call? 回答1: Obviously your service uses optimistic locking and expects an If-Match header,

OData : Why am I getting HTTP 428 (Precondition Required) error while performing an update

不羁岁月 提交于 2019-12-26 04:59:11
问题 So here's my code sap.ui.getCore().getModel("myModel").update("/ZSystemNameSet(mandt='001')", data, null, function(datay, responsey){ sap.ui.getCore().getModel().refresh(); MessageToast.show("It worked...!! Data: "+datay+"Response: "+responsey); }, function(datax,responsex){ MessageToast.show("Sorry! Data: "+datax+"Response: "+responsex); }); Also how do I add the header attributes to the update() call? 回答1: Obviously your service uses optimistic locking and expects an If-Match header,

How to filter DateTime data using sap.ui.model.Filter?

早过忘川 提交于 2019-12-25 18:38:49
问题 I've tried to filter DateTime data using sap.ui.model.Filter: oTableSearchState = [new Filter([ new Filter("Date", FilterOperator.Contains, sQuery), new Filter("Another_Date", FilterOperator.Contains, sQuery), ])] it return 400 Bad String . I found that the odata request is ...$filter substringof(,Date) . So I know it's not correct that using a "string filter" to filter date. what I need is ...$filter= Date ge datetime'2016-08-17T16:00:00Z' and Date lt datetime'2016-08-18T16:00:00' Can I do

How to filter DateTime data using sap.ui.model.Filter?

混江龙づ霸主 提交于 2019-12-25 18:38:07
问题 I've tried to filter DateTime data using sap.ui.model.Filter: oTableSearchState = [new Filter([ new Filter("Date", FilterOperator.Contains, sQuery), new Filter("Another_Date", FilterOperator.Contains, sQuery), ])] it return 400 Bad String . I found that the odata request is ...$filter substringof(,Date) . So I know it's not correct that using a "string filter" to filter date. what I need is ...$filter= Date ge datetime'2016-08-17T16:00:00Z' and Date lt datetime'2016-08-18T16:00:00' Can I do

How to use OData in ASP.NET Core 2.1?

て烟熏妆下的殇ゞ 提交于 2019-12-25 17:46:53
问题 I try to use OData in an ASP. Bellow my code: //============== Startup.cs public void ConfigureServices(IServiceCollection services) { services.AddDbContext<EntriesContext>( opt => opt.UseMySql("server=localhost;database=mydb;user=myusr;password=mypass", mysqlOptions =>{mysqlOptions.ServerVersion(new Version(5..), ServerType.MySql);})); services.AddOData(); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); ... } public void Configure(IApplicationBuilder app,

How to $select on OData Open Data Type? Query not valid error

試著忘記壹切 提交于 2019-12-25 13:46:53
问题 I'm serving an entity that has a Open Data Type of type: IDictionary I'm not able to use the $select keyword to select the dynamic data I have in that dictionary. I have other static atributtes that $select just fine. The error I'm getting is the following: { "error": { "code": "", "message": "The query specified in the URI is not valid. An identifier was expected at position 0.", "innererror": { "message": "An identifier was expected at position 0.", "type": "Microsoft.OData.ODataException",

dealing with dynamic properties on oData client

血红的双手。 提交于 2019-12-25 12:12:22
问题 I have the following class on both server and client public class Entity { public string Id {get; set;} public string Name {get; set;} public Dictionary<string, object> DynamicProperties {get; set;} } As far as I have seen all the examples of open type describes about having dynamic properties on the server side, but the properties on the client needs to be explicitly declared.When I send a POST request from the client how do i send the dynamic properties ?. I can't declare all the dynamic

dealing with dynamic properties on oData client

眉间皱痕 提交于 2019-12-25 12:12:01
问题 I have the following class on both server and client public class Entity { public string Id {get; set;} public string Name {get; set;} public Dictionary<string, object> DynamicProperties {get; set;} } As far as I have seen all the examples of open type describes about having dynamic properties on the server side, but the properties on the client needs to be explicitly declared.When I send a POST request from the client how do i send the dynamic properties ?. I can't declare all the dynamic

OData Expand Does Not Return Entity When Null

拜拜、爱过 提交于 2019-12-25 09:55:02
问题 I have an issue with odata. When a property that is being expanded is null it would throw an exception saying it could not find a property on the object it is expanding (obviously because it is null). I then updated Microsoft.Data.Edm to 5.6.1 as it says it has a fix for this issue. But the fix just removes any enitites from the returned data if any of the expanded properties in the entity are null. Has anyone else had this issue an have a solution for it. 回答1: You could use something like

How use multiples properties on “expand” parameter in List component [sapui]

喜欢而已 提交于 2019-12-25 09:42:59
问题 I have a sap.m.List component where invoke a list of OData objects. This object have others object inside it. For this reason, I use expand parameter for accessing to propertis of intern object. But when I put multiples objects on "expand" parameter, list component doesn't work: This way doesn't work: <List id="lstRequest" headerText="Custom Content" items="{ path: '/Requests', parameters: { expand: ['RequestTypeDetails', 'UsersDetails'] } }" > <StandardListItem title="{RequestTypeDetails