Hi,
I have a few questions regarding data & Submission.
I have beeen looking at different examples and posts that i could find that deals with data retrieval and submission in this project but so far alot of things you can normally do with entity seems to either require a strange way to complete or can not be done.
<ins>1) Submitting a collection of data:</ins> Is there a way to submit data through the repository based on a list/collection example. i am creating a sales order and would like to only submit the lines ones the user is done adding them and minipulating it. Sales Order Header Sales Order Lines (Multiple lines of data) <-- Bulk submit without requiring to loop through the lines
<ins>2) Retrieving Data with Sub Objects/Collections:</ins> I am currently trying to retrieve data from a header table: Business Partners This header table has 3 Lines Tables -Transactions -PriceLists -Cart
As soon as i pull the query and start with the Pagination/Orderby it does not want to order the Business Partners Table and throws and error: Message = "Argument types do not match"
This only occurs as a problem when i map the Lines Tables to the Object:
var query = _BusinessEntityRepository //.GetAll() .GetAllIncluding(x => x.AddressBook, x => x.Transactions, x => x.Carts) .WhereIf(!input.Filter.IsNullOrWhiteSpace(), c => c.Code.Contains(input.Filter)).Select(x => new BusinessEntityListDto { Code = x.Code, Name = x.Name, Description = x.Description, <ins>AddressBook = x.AddressBook, Carts = x.Carts, Transactions = x.Transactions,</ins> });
var BusinessEntityCount = query.Count();
**<ins>var BusinessEntitiesOrderBy = query.OrderBy(x => x.Id);</ins>**
var BusinessEntitiesPageBy = BusinessEntitiesOrderBy.PageBy(input);
Is there something i am doing wrong in handling Header/Line style Tables?
- Submit Entries with Sub Object Data:
If i have a table Business Partner and i link a PriceList to it. The price List object is causing the Insert to fail when i include it in the add (This with Entity framework would add the Object as a new object if Id field is empty or 0. This is not the case with current inserts. current inserts you have to first Add the object without linked objects before you can link a price lists when you get and update the Business Partner object. You also have to seperately add the pricelist object and get it and link it to the business partners with an update.
Is there another way to handle this as in a large business setting this might cause too many transaction to be processed to the backend/database.
I might be doing something wrong with the above 3 points but the documentation does not help in teaching people the best way to handle more in depth data objects insert and updates. This is my view as i am used to things that entity allowed when submitting objects.
Any information/help regarding the above topics would be greatly appreciated as i am trying to use the template to the max currently.
Regards, Gideon Badenhorst
2 Answer(s)
-
0
hi
These questions are not directly related with Asp.Net Zero so it'd better to ask it on StackOverflow.
-
0
Thanks,
Will do so. thought it might be the way the template structure works or something in that line.