public void LoadData() { if (!DataLoaded) { if (EntitiesId != null && EntitiesId.Length > 0) { this.DataLoaded = true; //Call for get entities by ids. OdooCommandContext context = new OdooCommandContext(); context.EntityName = OdooCommandContextFactory.GetOdooEntityName(typeof(T)); ResultSet result = this.Service.GetEntityCommand(context, this.EntitiesId); OdooObjectFactory.BuildEntities <T>(Service, result, this); } } }
private void LoadData() { if (!_dataLoaded) { var context = new OdooCommandContext(); context.EntityName = OdooCommandContextFactory.GetOdooEntityName(typeof(T)); var result = _service.GetEntityCommand(context, new List <object> { _id }); var collection = new Collection <T>(); OdooObjectFactory.BuildEntities(_service, result, collection); if (collection.Any()) { @object = collection.First(); } } }