I agree that everything in .NET is class based. I meant to say I have never created a class of my own.Hence it is difficult for me to work on this task. I apologize that I have wasted your time. Just wanted some explanation from your end because I felt that you were very much clear about my task. I still feel that a bit explanation from your end will help me understand this task and despite your explanation I failed to understand this task I will stop posting message. Hoping for some positive reply from your end.
But it's the logic, the background, and the reasoning that I can't explain - I only get a small text box to type into.
So go back to your course notes, go back to your textbook, and start reading. There is a lot to understand, and it's all absolutely basic and fundamental. Until you are up to speed with the whys and wherefores of classes, there is no point in your trying to do this exercise!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
What you're being asked to do is what the "Forms Designer" generates (in terms of code) in reponse to your "design" using design-time tools (toolbox; controls; etc).
Create a new C# Windows Forms project, and look at the "source code". The source code showns how a "program" builds a Windows UI using only code. Once you understand that (creating controls, adding to parent controls, updating layout), you'll be on your way.
(It's called "reverse_engineering", and is how the rest of the world beat the West).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
I made a HttpPost method, which sent a list of ids to a method in my service. The method then compared the ids to a anothers list, and return the object, which does´t contain the ids from the post request.
Now I want to make a HTTP Get method, which get the object after they are sorted
<pre> public List<ProductBO> GetAll()
using (var uow = facade.UnitOfWork)
return uow.ProductRepository.GetAll().Select(p => Pconv.Convert(p)).ToList();
public List<ProductBO> FilteretProduct(List<int> ids)
// Get all the product from the repositoryvar AllProducts = GetAll();
List<ProductBO> FilteredProducts = new List<ProductBO>();
// Runs through the list of all the products of var AllProductsforeach (var prod in AllProducts)
//Runs through list ids that we get from the controller post requestforeach (var id in ids)
/*If: the IngredientIds(list of ids) of the current
* product doesn't contain the current id
* Then add that product to the 'FilteredProducts' List*/if (!prod.IngredientIds.Contains(id))
//returning the listreturn FilteredProducts;
// This post request, gets the ids, which are used in the FilteretProduct method.
public List<ProductBO> FilteredList(List<int> ids)
return filterProduct = facade.ProductService.FilteretProduct(ids);
public List<ProductBO> GetFilteredList()
//The list from abovereturn filterProduct;
That doesn't make any sense. Web applications are stateless - they don't remember state from one request to the next. So even if you moved your local variable out of the POST method to make it available from the GET method, by the time you made the GET request, the content of the variable would have been lost.
You would need to use some form of session storage to persist the data between the requests. The precise details of how you do that will depend on how you're hosting your application, and whether you're using the full framework or .NET Core.
It's not clear why you would need two requests, when the POST request already returns the data?
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Those aren't requirements; that's a vague wishlist. For instance, what types of photo id are you accepting? What happens if the fingerprint scanner breaks down? How are the candidate details stored? How do you vote for them?